Jump to content

Whats wrong with this?


Recommended Posts

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.