I want to rewrite "http://domain.com/url-name/", to look at "http://domain.com/?url="url-name".
I am trying this but with no success :
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([^/]*)\$/ ^([^/]*)?url=$1
There are few mistakes:
$
then it will match literal $
.RewriteCond
to affect only non-files and non-directories.Change your code to this:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* ?url=$0 [L,QSA]