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. Link to comment https://forums.phpfreaks.com/topic/148568-problem-with-rewrite-please-need-your-advise/ 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 Link to comment https://forums.phpfreaks.com/topic/148568-problem-with-rewrite-please-need-your-advise/#findComment-780669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.