I have a webpage, which url looks like this:
http://www.mydomain.com/folder/index.php?title=The_title
The only problem is that I want it to look like one of these:
http://www.mydomain.com/folder/The_title
http://www.mydomain.com/folder/The_title.php
I have searched most of a lot and found one solution, which “works”:
RewriteEngine on
RewriteRule ^([^/]*)\.html$ /folder/index.php?title=$1 [L]
It does what it should, except the ending has to be “.html” (or “.kl”, if you like). This solution won’t accept “.php”, which gives me a “500 Internal Server Error”. Same thing happens if I try it without the extension.
EDIT:
Forgot to mention that the .htaccess file lies in the folder and not the root.
So, since I couldn’t get it to work properly I took the challange and started reading about mod_rewrite, which led to the solution:
If anyone else run into troubles I’ll recommend these sites:
more .htaccess tips and tricks..
An In Depth Guide to mod_rewrite for Apache