Link to home
Start Free TrialLog in
Avatar of nsanden
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
ASKER CERTIFIED SOLUTION
Avatar of sleep_furiously
sleep_furiously

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nsanden
nsanden

ASKER

Thank you! Works great... We're using the .htaccess method.