Forums / General Questions / My recently-added .htaccess redirect rule is preventing admin login

My recently-added .htaccess redirect rule is preventing admin login

Views: 1,200

Results 1 to 7 of 7
1 Mar 2012, 4:28 PM
#1
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

My recently-added .htaccess redirect rule is preventing admin login

Our site looks like 3 seperate sites on google.

purenappycakes.com
https://www.purenappycakes.com
joeyjoe.co.uk/purenappycakes

I have setup a .htaccess file like this:

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

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

But now we are unable to login to the admin panel. Is there a way around this?

2 Mar 2012, 2:39 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: My recently-added .htaccess redirect rule is preventing admin login

joecooper:

Our site looks like 3 seperate sites on google.

purenappycakes.com
www.purenappycakes.com
joeyjoe.co.uk/purenappycakes

Strictly speaking, they ARE separate sites.

joecooper:

I have setup a .htaccess file like this:

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

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

But now we are unable to login to the admin panel. Is there a way around this?

Don't know if its related, but surely
RewriteCond %{HTTP_HOST} ^joeyjoe.com [NC]
should be
RewriteCond %{HTTP_HOST} ^joeyjoe.co.uk [NC]

.....in order for this one to work?

Anyway having said that, I trust that you are aware that for most people, messing around with the .htaccess file(s) is generally pointless and cause more problems than they are attempting to solve.

Ironically, the less experience a person has, the more likely they are to mess with this file. Experienced Zenners tend to stay with the .htaccess files provided by zencart itself.. The people that created these are much more knowlegeable than the rest of us in regards to what should and shouldn't be needed/done.

Besides, most people would be happy to have 3 websites for the price of one, especially when only one of the three actually requires configuration & maintenance. :smile:

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

5 Mar 2012, 11:44 AM
#3
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: My recently-added .htaccess redirect rule is preventing admin login

Sorry but you are very wrong. Having one site accessible from multiple locations harms SEO rankings. Google will see the sites as separate sites with the same content, and de-rank them.

They aren't separate sites, it is the same site accessible from multiple locations, the files accessed are the same.

I am knowledgeable and its perfectly fine for me to edit these files.

Doesn't matter how experienced in zen cart someone is, it has nothing to do with the .htaccess file. Its the way my domain is setup which is causing the problem. But for some reason adding the redirect of "purenappycakes.com" to "www.purenappycakes.com" prevents access to the backend.

5 Mar 2012, 11:52 AM
#4
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: My recently-added .htaccess redirect rule is preventing admin login

Mine are set up like this and work fine.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.co.uk$
RewriteRule ^/?$ "http://www.mysite.com/" [R=301,L]

Give it a try.

5 Mar 2012, 12:17 PM
#5
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: My recently-added .htaccess redirect rule is preventing admin login

http://www.zen-cart.com/forum/showthread.php?t=193117
I had this same problem, and the only response i got from some "experienced" zen cart user, was that having the site accessible from 3 different domain variations was a good thing! These people don't seem to understand that if a site is accessible from both WWW. and non WWW, it affects your search engine rankings, despite what the links link to on the page.

I have edited both the config files under admin>includes and includes, but still having the problem of logging in.

What exactly was it you done to fix this?

Thanks

5 Mar 2012, 12:22 PM
#6
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: My recently-added .htaccess redirect rule is preventing admin login

never mind it seems to be working now... not sure what i done!

5 Mar 2012, 3:43 PM
#7
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: My recently-added .htaccess redirect rule is preventing admin login

thanks for your reply. I have something similar, its started working randomly, not sure what I done though but it works!