siwelis Posted February 15, 2009 Share Posted February 15, 2009 Hello! I've been working on this .htaccess file for two days, unfortunately. Options +Indexes Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteRule ^a/(.*)/?req=read&article_title=(.*)$ /a/$1/$2.html [R] RewriteRule ^cgi-bin/$ http://example.com/ [R] RewriteRule ^cgi-sys/scgiwrap/$ http://example.com/ [R] RewriteRule ^a/(.*)/(.*)\.html$ /a/$1/?req=go&name=$2 ErrorDocument 404 http://example.com/notfound.php I've got it all figured out except the redirecting in red. It's been a major pain in the butt. Nothing happens at all with that red code in there! I have one piece of code (in blue) to rewrite the url, and another (red) to redirect the old version to the new version. Do you have any idea what I'm doing wrong? Thank you so much! Quote Link to comment https://forums.phpfreaks.com/topic/145345-2-variable-redirection-issue/ Share on other sites More sharing options...
corbin Posted February 16, 2009 Share Posted February 16, 2009 What exactly are you trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/145345-2-variable-redirection-issue/#findComment-763090 Share on other sites More sharing options...
siwelis Posted February 16, 2009 Author Share Posted February 16, 2009 I'm sorry, I'm trying to redirect all urls like this example.com/a/Arts/?req=read&article_title=MonaLisa to example.com/a/Arts/MonaLisa.html but i need it to be it to redirect other categories too... example.com/a/News/?req=read&article_title=OsamaVSObamaBoxingMatch to example.com/a/News/OsamaVSObamaBoxingMatch.html Thank you for your response! Quote Link to comment https://forums.phpfreaks.com/topic/145345-2-variable-redirection-issue/#findComment-763111 Share on other sites More sharing options...
corbin Posted February 16, 2009 Share Posted February 16, 2009 Try changing: RewriteRule ^a/(.*)/?req=read&article_title=(.*)$ /a/$1/$2.html [R] To RewriteRule ^a/(.*)/\?req=read&article_title=(.*)$ /a/$1/$2.html [R] Although I would be surprised if that were the problem. Quote Link to comment https://forums.phpfreaks.com/topic/145345-2-variable-redirection-issue/#findComment-763121 Share on other sites More sharing options...
siwelis Posted February 16, 2009 Author Share Posted February 16, 2009 I tried it and you were right that it didn't change anything. Funny... I just realized a new appreciation for error messages. lol. I'll keep researching and if I find anything I'll post the answer I find here. If you think of anything please let me know. Thank you for looking into this already. Quote Link to comment https://forums.phpfreaks.com/topic/145345-2-variable-redirection-issue/#findComment-763127 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.