saariko Posted March 9, 2009 Share Posted March 9, 2009 Hi, I am trying to rewrite from: http://www.domain.com/a/VALUE to http://www.domain.com/a/p.php?id=VALUE I have tried the following, but nothing works RewriteBase / Rewritecond %{REQUEST_URI} !(^/a/*$) [NC] RewriteRule a/([0-9]+) /a/p.php?id=$1 [L] RewriteBase / RewriteRule ^a/(.*)$ a/p.php?id=$1 [R=301,L] RewriteCond %{HTTP_HOST} ^domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301] RewriteRule ^a/([A-Za-z0-9-]+)?$ a/p.php?id=$1 [NC] My .htaccess is in my http root folder, do I need to move it to my /a/ directory? and change the rules? If I try to play with the rules, and lets say do a redirect to : www.cnn.com it works, but I really need to rewrite for it to work. Thank you very much. Quote Link to comment Share on other sites More sharing options...
corbin Posted March 9, 2009 Share Posted March 9, 2009 Try: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^a/([^/]+)/?$ /a/p.php?id=$1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.