LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > "Redirection Loop"

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2009, 02:28 AM
iUnknown iUnknown is offline
Member
 
Join Date: Nov 2008
Posts: 38
Default "Redirection Loop"

Quote:
Redirect Loop

Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked.
This is the error that I get when I try to load a perfectly normal website which has created a redirect in their cPanel to redirect to a directory on their website.

In the .htaccess:

Code:
RewriteEngine on

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName domain.com
AuthUserFile /home/username/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/username/public_html/_vti_pvt/service.grp

RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^.*$ "http\:\/\/domain\.com\/cubecart\/index\.php" [R=301,L]
I have contacted cPanel and they say that this is a litespeed error rather than anything they can support/fix. Is this "RewriteRule" buggy in litespeed... and what can I do to fix this and get the redirect working?

Thank you very much!
Reply With Quote
  #2  
Old 04-25-2009, 05:03 AM
auser auser is offline
Senior Member
 
Join Date: Mar 2009
Posts: 119
Quote:
Originally Posted by iUnknown View Post

RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^.*$ "http\:\/\/domain\.com\/cubecart\/index\.php" [R=301,L]

[/CODE]
This will cause infinite redirect:
Code:
http://domain.com-->http://domain.com/domain.com-->http://domain.com/domain.com/domain.com/...
try: change last RewriteRule to
Code:
RewriteRule ^.*$  /cubecart/index.php [L]
Reply With Quote
  #3  
Old 04-25-2009, 05:12 AM
iUnknown iUnknown is offline
Member
 
Join Date: Nov 2008
Posts: 38
Hi,

Thanks for the response! That kind of works but it shows the content of /cubecart whilst staying on the main domain which breaks some of the images etc.

How can I make it fully redirect the URL to /cubecart?

Thanks again.
Reply With Quote
  #4  
Old 04-25-2009, 05:59 AM
auser auser is offline
Senior Member
 
Join Date: Mar 2009
Posts: 119
can't get out a good Rewrite Rule at the moment

there is one workaround may work in your case.
create a index.html in your document root:

Code:
<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=cubecart/index.php">
</head>
</html>
Reply With Quote
  #5  
Old 04-25-2009, 06:02 AM
iUnknown iUnknown is offline
Member
 
Join Date: Nov 2008
Posts: 38
Quote:
Originally Posted by auser View Post
can't get out a good Rewrite Rule at the moment

there is one workaround may work in your case.
create a index.html in your document root:

Code:
<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=cubecart/index.php">
</head>
</html>
I know that is an option but I am looking for a way to do it by .htaccess which should work fine in Litespeed... are you saying I cannot do this?

Thanks.
Reply With Quote
  #6  
Old 04-25-2009, 06:14 AM
auser auser is offline
Senior Member
 
Join Date: Mar 2009
Posts: 119
how about this one? just one line:
Code:
RewriteRule ^/$  http://domain.com/cubecart/index.php [L]
Reply With Quote
  #7  
Old 04-25-2009, 06:17 AM
iUnknown iUnknown is offline
Member
 
Join Date: Nov 2008
Posts: 38
That just doesn't redirect :P

(Edit: and yes I have changed domain.com appropriately)
Reply With Quote
  #8  
Old 04-25-2009, 07:42 AM
auser auser is offline
Senior Member
 
Join Date: Mar 2009
Posts: 119
just looked up apache document:
http://httpd.apache.org/docs/trunk/r...ite_intro.html

"The main difference with per-server rewrites is that the path prefix of the directory containing the .htaccess file is stripped before matching in the RewriteRule"

so there's difference for per-server and per-directory rewrite rule.
(just know it )

the one line RewriteRule in my last post works for per-server rewrite.
the per-directory version is
Code:
RewriteRule ^$  http://domain.com/cubecart/index.php [L]
tested on my box, it's working in .htaccess
Reply With Quote
  #9  
Old 04-25-2009, 07:47 AM
iUnknown iUnknown is offline
Member
 
Join Date: Nov 2008
Posts: 38
Hi,

Thanks very much. It doesn't seem to work but just before you posted that I've decided to just use one of your previous ideas of the HTML redirect and that does the job fine so I'll leave it like that.

If this problem arises again with a different account, I'll try your new method!

Thanks very much.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:09 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.