I am trying to get page.php?title=foo to change to /page/foo. I’ve got it working to the point the page.php goes to /page/, but when I do page.php?title=foo it rewrites the url to /page/title?title=foo.
I’d like to remove the ?title=foo part of the last url. Any ideas?
I’m new to this – I tried to follow tutorials but am unsure what the [OR] and [NC] (etc) mean.
RewriteEngine on
RewriteCond %{QUERY_STRING} ^$ [OR]
RewriteCond %{QUERY_STRING} ^title=(.*)$ [NC]
RewriteRule ^page.php$ page/%1 [NC,L,R=301]
You can do something like this:
So, when user ask
http://example.com/page/foo, Apache will open himhttp://example.com/page.php/?title=foo. But adressbar is still withhttp://example.com/page/foo