techiefreak05 Posted April 11, 2008 Share Posted April 11, 2008 Ive tried many different variations of this rewrite, but nothing works: RewriteEngine on RewriteRule ^go/([0-9a-zA-Z]+)$ redir/?goto=$1 [L] It needs to redirect from "/go/(anything)" => "/redir/?goto=(anything)" But when i go to "/go/95c4fa14" I get a 404 error.. My host is 1and1. any hints? Quote Link to comment https://forums.phpfreaks.com/topic/100659-rewrite-rule-not-working/ Share on other sites More sharing options...
wildteen88 Posted April 11, 2008 Share Posted April 11, 2008 Should work find as long as you have a index.php file in the redir/ folder. Try specifying the filename too: RewriteEngine on RewriteRule ^go/([0-9a-zA-Z]+)$ redir/index.php?goto=$1 [L] Quote Link to comment https://forums.phpfreaks.com/topic/100659-rewrite-rule-not-working/#findComment-514929 Share on other sites More sharing options...
techiefreak05 Posted April 11, 2008 Author Share Posted April 11, 2008 http://tinywebbies.com/go/95c4fa14 I still get a 404 error But if you go here: http://tinywebbies.com/redir/index.php?goto=95c4fa14 it works... Quote Link to comment https://forums.phpfreaks.com/topic/100659-rewrite-rule-not-working/#findComment-514967 Share on other sites More sharing options...
wildteen88 Posted April 11, 2008 Share Posted April 11, 2008 Maybe Apache is not reading your .htaccess file. You can tell this by placing some invalid commands into the .htaccess file eg: foobar123 # an invalid command RewriteEngine on RewriteRule ^go/([0-9a-zA-Z]+)$ redir/index.php?goto=$1 [L] When you go to your site or folder the .htaccess is in you should get an 500 Internal Server Error message appear. If you dont Apache is not configured to read .htaccess files. I tried the rewriterule and they both work fine. Quote Link to comment https://forums.phpfreaks.com/topic/100659-rewrite-rule-not-working/#findComment-514980 Share on other sites More sharing options...
techiefreak05 Posted April 11, 2008 Author Share Posted April 11, 2008 I do get a 500 Error. The weird thing is, Putting in "RewriteBase /" (without quote) in my .htaccess gives me a 500 erro as well! When a while ago, it didnt. 1and1 is very bizarre... Quote Link to comment https://forums.phpfreaks.com/topic/100659-rewrite-rule-not-working/#findComment-515134 Share on other sites More sharing options...
techiefreak05 Posted April 14, 2008 Author Share Posted April 14, 2008 I've come to the conclusion its 1&1's server .. any idea what to do? Im not about to use their technical support cuz its garbage... Quote Link to comment https://forums.phpfreaks.com/topic/100659-rewrite-rule-not-working/#findComment-516451 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.