I'm trying to setup mod rewrite for a new script. The script will run within a sub folder of a site and is similar to a blog. Currently you can access page like this: domain.com/script/index.php?url=index (The index page) domain.com/script/index.php?url=Category (The category page) domain.com/script/index.php?url=this-blog-entry-about-something (a blog entry) When the rewrite happens I want the url to display like the following domain.com/script/index.php (The index page) domain.com/script/Category.php (The category page) domain.com/script/this-blog-entry-about-something.php (a blog entry) I have tried numerous options, the latest is below but it still doesn't work. Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteRule ^script/([^/]*)\.php$ /script/index.php?url=$1 [L] Code (markup): Any idea what I'm doing wrong?
May be the problem of * try to change to + RewriteRule ^script/([^/][COLOR="Red"]+[/COLOR])\.php$ /script/index.php?url=$1 [L] Code (markup):
Try this: Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteBase / RewriteRule ^script/(.*)\.php$ /script/index.php?url=$1 [nc,L] Code (markup):