Link to home
Start Free TrialLog in
Avatar of jeremyBass26
jeremyBass26Flag for United States of America

asked on

500 error mod_rewrite: maximum number of internal redirects reached

Hello, I am finishing up a new site use a CMS... but this site is located on Godaddy, and there is no way to get it off... and I am getting a 500 error, so it says, and the log error is "mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if necessary."  Fun fun, and of course Godaddy rather me poke around then work with me to solve this... so after google'n this it seems, (which I suspected) it's a problem with the .htaccess...

So the specs:
CMSMS 1.2.5
no extra mods over install

pretty URLs turned on

server is linux
SSL
PHP 5.x
MySQL 5.0

what is happening is that the pretty URL says (with dwproduction.com being the primary domain)
dwproduction.com/HunterEducation/

but HunterEducation.com (were the 500 error occurs)
is not showing up with
HUNTEREDUCATION.COM going to dwproduction.com/HunterEducation/
which is set up via Godaddy's Domain Management in the Hosting Control Center

the suspected issue area
# CMSMS Rewriting
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# END CMSMS

also tryed:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

As i was told that  [NC] may not work... told don't know... :)


Any one know how to rewrite this to make it work right, with out using up a tons of server resources?...

I had it working before with another site a using 5 domain names pointing to the pretty urls with out using forwarding 301 permanent. And using the same .htaccess.  Thanks have a great day all...

jeremyBass

side note, what is the draw back to doing a forwarding 301 permanent?
*************************************
the full .htaccess below
*************************************

[code]# BEGIN Optional settings
 
# Turns off directory browsing
# not absolutely essential, but keeps people from snooping around without 
# needing empty index.html files everywhere
Options -Indexes
 
# Deny access to config.php
# This can be useful if php ever breaks or dies
# Use with caution, this may break other functions of CMSms that use a config.php
# file.  This may also break other programs you have running under your CMSms
# install that use config.php.  You may need to add another .htaccess file to those
# directories to specifically allow config.php.
<Files "config.php">
order allow,deny
deny from all
</Files>
 
# Sets your 403 error document
# not absolutely essential to have, 
# or you may already have error pages defined elsewhere
ErrorDocument 403 /forbidden403.shtml
 
# No sense advertising what we are running
ServerSignature Off
 
# END Optional Settings
 
# BEGIN CMSMS and Rewrite Rules
# Make sure you have Options FollowSymLinks
# and Allow on
 
RewriteEngine On
 
# Might be needed in a subdirectory
#RewriteBase /
 
# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]
#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]
#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]
#OR if the URI contains a "<script>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 
RewriteRule ^.*$ - [F,L] 
# END Filtering
 
# CMSMS Rewriting
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# END CMSMS
 
# END Rewrite rules
[/code]

Open in new window

SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jeremyBass26

ASKER

nope that didn't work...  tryed both

RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA,L]


also tryed:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA,L]
So I'm fallowing tinhat's  suggestions as they are close to what Godaddy said should work... but it's only showing the root not moving to the location of http://dwproductions.com/HunterEducation... Please and help to get this going would be great... there is very little in the way of information on Google and that is spotty as well... Thanks

huntereducation.com is alaised to the root of dwproduction.com


rewrite as suggested...

RewriteCond {%HTTP_HOST} huntereducation\.com
RewriteRule ^/$ /HunterEducation
# CMSMS Rewriting
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]


in full

# BEGIN Optional settings
 
# Turns off directory browsing
# not absolutely essential, but keeps people from snooping around without 
# needing empty index.html files everywhere
Options -Indexes
 
# Deny access to config.php
# This can be useful if php ever breaks or dies
# Use with caution, this may break other functions of CMSms that use a config.php
# file.  This may also break other programs you have running under your CMSms
# install that use config.php.  You may need to add another .htaccess file to those
# directories to specifically allow config.php.
<Files "config.php">
order allow,deny
deny from all
</Files>
 
# Sets your 403 error document
# not absolutely essential to have, 
# or you may already have error pages defined elsewhere
ErrorDocument 403 /forbidden403.shtml
 
# No sense advertising what we are running
ServerSignature Off
 
# END Optional Settings
 
# BEGIN CMSMS and Rewrite Rules
# Make sure you have Options FollowSymLinks
# and Allow on
 
RewriteEngine On
 
# Might be needed in a subdirectory
#RewriteBase /
 
# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]
#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]
#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]
#OR if the URI contains a "<script>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 
RewriteRule ^.*$ - [F,L] 
# END Filtering
 
RewriteCond {%HTTP_HOST} huntereducation\.com
RewriteRule ^/$ /HunterEducation
# CMSMS Rewriting
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
 
# END CMSMS
 
# END Rewrite rules

Open in new window

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial