500 error mod_rewrite: maximum number of internal redirects reached [solved]

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
JeremyBASS

500 error mod_rewrite: maximum number of internal redirects reached [solved]

Post by JeremyBASS »

Hello, I am finishing up a new site use this wonderful CMS, been toting this big time as I believe it is the best option out there... 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 www.dwproductions.com being the primary domain)
www.dwproductions.com/HunterEducation/

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

the suspected issue area

Code: Select all

# 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

the full .htaccess

Code: Select all

# 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
Any one know how to rewrite this to make it work right?...

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
Last edited by JeremyBASS on Wed Jun 18, 2008 3:55 am, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by calguy1000 »

Unfortunately, I can't help with the mod_rewrite stuff, but...

I would like to commend you on the well worded, well researched, well explained post.

Please everybody, look at this post and see how it 'should' be done.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JeremyBASS

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by JeremyBASS »

Why thanks, I got all excited think I had an answer but a complement is always good, :) laters
alby

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by alby »

JeremyBASS wrote:

Code: Select all

# 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
Try to removing [NC] from "-f" and "-d", sometime "NC" is not valid for "-f" and "-d"

Alby
JeremyBASS

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by JeremyBASS »

Well no luck... changed...

Code: Select all

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

Code: Select all

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
:(
User avatar
tinhat
Forum Members
Forum Members
Posts: 65
Joined: Fri May 23, 2008 6:33 am

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by tinhat »

There are some mysteries that need clearing up.

Firstly, dwproduction.com points to these name servers:
dwproduction.com. 172779 IN NS ns2.powweb.com.
dwproduction.com. 172779 IN NS ns1.powweb.com.

But they aren't returning ANY results for the domain name.
So the domain dwproduction.com is not resolving at this moment in time.

Ok to huntereducation.com You say you are redirecting http://huntereducation.com to http://dwproduciton.com/HunterEducation

How are you doing this? I am not aware of there being any way to redirect a parked domain to some other location in the godaddy control panel - although I am no expert user of it.

At face value there is nothing unusual about the contents of the .htaccess file you have presented. But neither is there any thing in there that points to there being any redirect in place for huntereducation.com

I have experienced caching problems with godaddy's apache web servers and their seeming to cache .htaccess file contents. I have found that deleting (or renaming) the .htaccess file, then accessing the domain (in the browser) then reinstating the .htaccess file has helped in the past.

If you can provide any more information about how you are achieving this redirect of huntereducation.com it will help because I am a bit confused at this moment.
JeremyBASS

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by JeremyBASS »

Firstly, dwproduction.com points to these name servers:
dwproduction.com.    172779    IN    NS ns2.powweb.com. 
dwproduction.com.    172779    IN    NS ns1.powweb.com.
I can get to it just find it's http://www.dwproductions.com/ not dwproduction.com I missed the "s"
Ok to huntereducation.com You say you are redirecting http://huntereducation.com to http://dwproduciton.com/HunterEducation
Yes:)
How are you doing this? I am not aware of there being any way to redirect a parked domain to some other location in the godaddy control panel - although I am no expert user of it.
It's in Godaddy's Domain Management in the Hosting Control Center
I have experienced caching problems with godaddy's apache web servers and their seeming to cache .htaccess file
try what you suggested and no luck
If you can provide any more information about how you are achieving this redirect of huntereducation.com it will help because I am a bit confused at this moment.
sorry i don't know what else you'r looking for there, i thought i put up everything :)


Thanks for the help here..
jeremyBass
JeremyBASS

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by JeremyBASS »

Also tryed

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

and

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


???
User avatar
tinhat
Forum Members
Forum Members
Posts: 65
Joined: Fri May 23, 2008 6:33 am

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by tinhat »

Hi again

>

Have you noticed this?

http://dwproductions.com/HunterEducatio ... rEducation - Works!
http://dwproductions.com/HunterEducation/hunting_links - Works!

So there is something within how the redirect you have set up in the goddady control panel that is not working with the .htaccess redirects. Something to contemplate, but see my solution below.

>

OK - it helps to know the correct domain name ;)

My knowledge of adding domains in godaddy hosting might be limited because I only have a basic account which I use to host a blog and don't have the host multiple domains feature that more expensive plans have. I can only park domains. I can't point them to other directories or redirect them via the control panel.

The only thing I can suggest is that you:

1) Remove any redirect for the domain huntereducation.com in the control panel. Just point the domain to the same document_root as dwproductions.com

We can deduce that there is a problem with the configuration of huntereducation.com because dwproductions.com is configured fine - the htaccess is not causing problems with it.

You will have to wait for the dumb godaddy system to pick up and apply the changes. Takes a few minutes.

2) Now add the following to the .htaccess file. Put this line *before* those last three lines that do the pretty url rewriting.

RewriteCond {%HTTP_HOST} huntereducation\.com
RewriteRule ^/$ /HunterEducation

That should work, because I use rewrite conditions on the http_host header to squeeze a second website on my basic godaddy account. I hope it helps.
Last edited by tinhat on Wed Jun 04, 2008 7:34 pm, edited 1 time in total.
JeremyBASS

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by JeremyBASS »

Have you noticed this?
Yes I did and it has always work there... but  ::) that is only sort of ok...

So for EVERYONES FYI if your are have Godaddy give you the run around and feel like shoving you head through you monitor well hold off for a bit, and write the PR department and also to Bob Parsons, they don't take those emails lightly, but I'd suggest only use it for your last resort as you'll ruin that for everyone...

back on track and also why i just said all that... Godaddy is taking a look at the .htaccess file and the server settings and trying to work it out... they understand now the idea, that the mod rewrite  http://dwproduciton.com/HunterEducation is like having a virtual folder of HunterEducation.

So if they fail I'll try your last suggestion but I'm try to just use http://dwproduciton.com/HunterEducation to have an alias of http://huntereducation.com not do any redirects, Google hates that...

"G" places lol... they are trying to rule
JeremyBASS

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by JeremyBASS »

wait wait wait... i was going over this again... why in the heck is http://dwproductions.com/HunterEducatio ... rEducation working?
is that not an issue?
JeremyBASS

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by JeremyBASS »

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

rewrite as suggested...

Code: Select all

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

Code: Select all

# 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
User avatar
tinhat
Forum Members
Forum Members
Posts: 65
Joined: Fri May 23, 2008 6:33 am

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by tinhat »

This time it was my turn to make the typo. This is what I should have suggested:

RewriteCond %{HTTP_HOST} huntereducation\.com
RewriteRule ^/$ /HunterEducation

That should do the trick. And the nice thing is that the user isn't redirected. They will see the website under the huntereducation.com domain. The rewrite happens behind the scenes. Try this out first.

If you don't want that and really want to redirect them instead then use:

RewriteCond %{HTTP_HOST} huntereducation\.com
RewriteRule ^/$ http://www.dwproductions.com/HunterEducation [R=301,L]
Last edited by tinhat on Thu Jun 05, 2008 6:40 pm, edited 1 time in total.
JeremyBASS

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by JeremyBASS »

:(well that gave a 400 bad request error..

what I'm wanting is that when some one types huntereducation.com
they go to  http://www.dwproductions.com/HunterEducation but see http://www.huntereducation.com

and so if the clicked on hunting_links they get http://www.huntereducation.com/hunting_links/
not
http://dwproductions.com/hunting_links/
******************
edit
***************
thinking about it i think i'd have to move all to a parented structur on a "page" huntereducation
sooo...  http://dwproductions.com/huntereducation/hunting_links/ would be http://www.huntereducation.com/hunting_links/

and
http://dwproductions.com/huntereducation would be http://www.huntereducation.com

**********************************

it's got to be close now lol thanks tinhat

here is the current

Code: Select all

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]
Last edited by JeremyBASS on Thu Jun 05, 2008 6:46 pm, edited 1 time in total.
User avatar
tinhat
Forum Members
Forum Members
Posts: 65
Joined: Fri May 23, 2008 6:33 am

Re: 500 error mod_rewrite: maximum number of internal redirects reached

Post by tinhat »

OK. I think I have the solution. Let me test locally and I will post back
Post Reply

Return to “The Lounge”