Forums / Installing on a Linux/Unix Server / .htaccess in /public_html/ causes log-in failure

.htaccess in /public_html/ causes log-in failure

Locked

Started by avidre on 22 Mar 2009, 11:16 AM · Views: 2,069

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
22 Mar 2009, 11:16 AM
#1
avidre avatar

avidre

New Zenner

Join Date:
Mar 2009
Posts:
1
Plugin Contributions:
0

.htaccess in /public_html/ causes log-in failure

Hope this helps solve someone's initial (new install) log-in problem:

If I have a FollowSymLinks line in my .htaccess [/public_html/] that adds "www", my log-in will fail, since the log-in defaults to the domain name/directory with NO "www"

comment-out the lines:

Options +FollowSymLinks

RewriteEngine on

RewriteCond %{HTTP_HOST} ^domain.com [NC]

RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

:D

22 Mar 2009, 1:40 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: .htaccess in /public_html/ causes log-in failure

Um, actually, the FollowSymLinks statement has nothing to do with login, nor with whether a "www" is included in the URL.
But the Rewrite statements on the other lines do.

The real advice is not to comment things out, but instead to make sure that if you have your .htaccess configured to forced the "www." to be added to the URL, then you ALSO need to make sure that your /includes/configure.php file includes the "www." in the HTTP_SERVER and HTTPS_SERVER settings. Otherwise you'll create a redirect "loop" that stops everything from working.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

22 Mar 2009, 2:56 PM
#3
daneh avatar

daneh

Zen Follower

Join Date:
Dec 2007
Location:
Southern Maine
Posts:
268
Plugin Contributions:
0

Re: .htaccess in /public_html/ causes log-in failure

DrByte,

About that loop....I have tried to add the www. to my configures two times. Both times I just get a loop at the admin login screen.

Any idea why adding the www. to admin configure does that?
It works fine if I just add it to the html/includes/configure, but the admin configure screws things up.

22 Mar 2009, 5:13 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: .htaccess in /public_html/ causes log-in failure

Then you probably have a bad combination of redirect rules vs the URLs you're using in your admin configure.php settings. If your admin is using a different URL for SSL (such as a shared SSL), then maybe you will need to be more specific about your rewrite rules ... in that case, you may have to engage the help of your hosting company.

Why do you need the www. prefix on your admin side anyway?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.