0

I have a server with multiple websites in same place Scenario is as belows ABC/123 ABC/456 ABC/789

The 123 is pointed to www.123.com The 456 is pointed to www.456.com The 789 is pointed to www.789.com

now i want www.123.com redirected to 123.com.

i added below code in htaccess file

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.123\.com [NC]
RewriteRule ^(.*)$ http://123.com/$1 [L,R=301]

But it says too many redirects detected.

Does any one have a solution to this Joomla version is 3.6.4

4
  • 1
    Your going to drive your server (and users for that matter) absolutely crazy, with all the redirects. You're already redirecting 123 to www.123.com, so don't do it again, remove this and simply redirect 123 to www.456.com instead.
    – Lodder
    Commented Dec 19, 2016 at 11:09
  • sorry i have updated the information now, previously i messed adding the info Commented Dec 20, 2016 at 6:39
  • Joomla and Joomla version is irrelevant to this problem.
    – FFrewin
    Commented Feb 18, 2017 at 8:10
  • 1
    @BrijeshSavaliya it appears that you have never accepted an answer to one of your questions in the Stack Exchange Network. Please see that all of your questions are progressed to a system-recognized resolution (accepted answer, closed question, deleted question). Please read: meta.stackexchange.com/a/5235/352329 Commented Aug 12, 2019 at 8:34

1 Answer 1

1

You have a redirect loop in your .htaccess file, you are redirecting from A to B and then to A.

A method to (uncleanly) address redirect loop situation in the .htaccess file is to add the following to your .htaccess file immediately after RewriteEngine On:

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]

The above should ensure that a redirect rule is only triggered once.

Update based on your update: Please check if you have an SEF plugin redirecting non-www to www. This where your redirect loop might be coming from.

2
  • sorry, previously i messed up the question i have updated the question, so can you please look into the problem Commented Dec 20, 2016 at 6:40
  • 1
    @Brejish you will still have a redirect loop. You're going from A to B, then back to A
    – Lodder
    Commented Dec 20, 2016 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.