therealwesfoster Posted April 24, 2009 Share Posted April 24, 2009 Options +FollowSymLinks Options All -Indexes RewriteEngine On RewriteRule ^artisan-(.*?).html ./acpage.php?p=$1 [NC,L] RewriteRule ^(.*?).html ./$1.php [NC,L] I keep getting 500 errors. Wes Link to comment https://forums.phpfreaks.com/topic/155536-whats-wrong-with-this/ Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 24, 2009 Share Posted April 24, 2009 Try that : Options +FollowSymLinks Options All -Indexes RewriteEngine On RewriteRule ^artisan-(.*)\.html$ acpage.php?p=$1 [NC,L] # RewriteRule ^(.*)\.html$ $1.php [NC,L] I remove the ungreedy ? (isn't needed it seem always ungreedy from my experience) add slashes to the dot in the regex and close it $ and remove the ./ from the target not needed too. I'm not sure about the last one as i never try that. If it don't work comment it to find which one bug. Link to comment https://forums.phpfreaks.com/topic/155536-whats-wrong-with-this/#findComment-818702 Share on other sites More sharing options...
Mchl Posted April 24, 2009 Share Posted April 24, 2009 And make sure mod_rewrite is actually enabled. Link to comment https://forums.phpfreaks.com/topic/155536-whats-wrong-with-this/#findComment-818704 Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 24, 2009 Share Posted April 24, 2009 And make sure mod_rewrite is actually enabled. I thought since the server return a 500 internal error that mod_rewrite was on and it's code was buggy. But i made some test and you are right the server return a 500 code if mod_rewrite is off too. A better code is : Options +FollowSymLinks Options All -Indexes <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^artisan-(.*).html$ acpage.php?p=$1 [NC,L] RewriteRule ^(.*).html$ $1.php [NC,L] </IfModule> It will return a 404 or a 403 (if you don't the file and since -Indexes is on) instead of a 500 if mod_rewrite isn't enable. Link to comment https://forums.phpfreaks.com/topic/155536-whats-wrong-with-this/#findComment-818718 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.