nsanden
asked on
mod_rewrite regular expression problem
Hi guys...
I use:
RewriteRule ^([^/]+)*.html /index.php?name=$1
which basically turns a URL like http://www.mysite.com/page.html into http://www.mysite.com/index.php?name=page
This works great except for one thing. I want to be able to turn URL's such as http://www.mysite.com/directory/page.html into http://www.mysite.com/index.php?name=directory/page
and http://www.mysite.com/directory1/directory2/page.html into http://www.mysite.com/index.php?name=directory1/directory2/page
Can anyone help me with that? THANKS
I use:
RewriteRule ^([^/]+)*.html /index.php?name=$1
which basically turns a URL like http://www.mysite.com/page.html into http://www.mysite.com/index.php?name=page
This works great except for one thing. I want to be able to turn URL's such as http://www.mysite.com/directory/page.html into http://www.mysite.com/index.php?name=directory/page
and http://www.mysite.com/directory1/directory2/page.html into http://www.mysite.com/index.php?name=directory1/directory2/page
Can anyone help me with that? THANKS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER