Forum

Thread tagged as: Question, Configuration, Hosting

mod_rewrite Internal Server Errors

I'm working locally on a Perch website using MAMP. I have been able to get mod_rewrite working to hide extensions with no problem, but I can't blog pages to work. I get Internal Server Error messages. I have the same issue when uploading to my MediaTemple server.

This is my .htaccess file:

<IfModule mod_rewrite.c>

Options +FollowSymLinks
RewriteEngine On

# RewriteCond %{HTTP_HOST} ^blackhawkpetcare.com.au [NC]
# RewriteRule ^(.*)$ https://www.blackhawkpetcare.com.au/$1 [L,R=301]

# Redirect to PHP if it exists.
# e.g. example.com/foo will display the contents of example.com/foo.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]

RewriteRule ^post/([a-zA-Z0-9-/]+)$ /post.php?s=$1 [L]

</IfModule>

Redirect 301 /about /about-blackhawk

Any ideas on what might be wrong?

Brad Hardinge

Brad Hardinge 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Not really a Perch question, but try moving your rule for blog to come before the catch-all rule.

Thanks Drew. I understand it's not a Perch issue, just struggled to find somewhere to get help.

That fix didn't work locally, but does work on the Mediatemple staging server.

Any tips on where/how I can debug mod_rewrite issues locally?

Drew McLellan

Drew McLellan 2638 points
Perch Support