When I configured
Friendly URLs on my localhost using
XAMPP 1.7.4 and following the instructions at:
http://rtfm.modx.com/display/revolution20/Using+Friendly+URLs
I encountered two problems:
1.
Server Error! Error 500 (a.k.a. HTTP 500 Internal Server Error)
2.
The page isn’t redirecting properly; Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
OR
This webpage has a redirect loop; The webpage at
http://yourdomain.local/ has resulted in too many redirects.
The 1st error is triggered by line 13.
ExpiresActive On in the
.htaccess file. It was resolved by:
1. Stop the Apache service
2. Remove the # symbol from the beginning of the following line (approx. line 98) in
httpd.conf found at \xampp\apache\conf :
#LoadModule expires_module modules/mod_expires.so
3. Start Apache service
4. Clear cache in your internet browser
The 2nd error is triggered by line 6. of the
.htaccess file.
RewriteCond %{HTTP_HOST} !^www\.DOMAINNAME\.TLD [NC]
It was resolved by:
1. Removing the www\. part of the above line to look like this:
RewriteCond %{HTTP_HOST} !^DOMAINNAME\.TLD [NC]
2. Clear cache in your internet browser
My .
htaccess file now looks like this:
# Friendly URLs Part
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} .
# Force all pages to go to www.domain.com for SEO
RewriteCond %{HTTP_HOST} !^mydomain\.local [NC]
RewriteRule (.*) http://mydomain.local/$1 [R=301,L]
# Friendly URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
# Additional Settings Follow
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
BrowserMatch "MSIE" brokenvary=1
BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
BrowserMatch "Opera" !brokenvary
SetEnvIf brokenvary 1 force-no-vary