taith Posted September 15, 2012 Share Posted September 15, 2012 hello, ive lately been having a mod rewrite error, and i was hoping someone could help... RewriteRule ^(.*)$ site.php?s=$1 [L] it should be turning "url.com/pagenames/id" into "site.php?s=pagenames/id" but its just giving me a 500 internal server error. help? Quote Link to comment https://forums.phpfreaks.com/topic/268415-mod-rewrite-failing/ Share on other sites More sharing options...
requinix Posted September 16, 2012 Share Posted September 16, 2012 That will rewrite itself into a loop. Add a condition that the file must not exist. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ site.php?s=$1 [L] Quote Link to comment https://forums.phpfreaks.com/topic/268415-mod-rewrite-failing/#findComment-1378258 Share on other sites More sharing options...
taith Posted September 16, 2012 Author Share Posted September 16, 2012 RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^*$ site.php?s=$1 [L] is still ISE'ing... when i remove the rule, everything works happily... :S Quote Link to comment https://forums.phpfreaks.com/topic/268415-mod-rewrite-failing/#findComment-1378486 Share on other sites More sharing options...
requinix Posted September 17, 2012 Share Posted September 17, 2012 RewriteRule ^*$ site.php?s=$1 [L] That's not quite what I wrote. Quote Link to comment https://forums.phpfreaks.com/topic/268415-mod-rewrite-failing/#findComment-1378492 Share on other sites More sharing options...
taith Posted September 17, 2012 Author Share Posted September 17, 2012 sorry, that was my tinkering to try get it working again... and no, it is still failing... RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ site.php?s=$1 [L] Quote Link to comment https://forums.phpfreaks.com/topic/268415-mod-rewrite-failing/#findComment-1378495 Share on other sites More sharing options...
taith Posted September 17, 2012 Author Share Posted September 17, 2012 aha! mybad! was aparently missing a file... strange error to get tho... thank you VERY kindly for your help! Quote Link to comment https://forums.phpfreaks.com/topic/268415-mod-rewrite-failing/#findComment-1378496 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.