Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.