Advertisement

07.24.2008 at 05:23PM PDT, ID: 23594253
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

Having trouble configuring .htaccess the way I need it to work...???

Asked by angelleye in Apache Web Server, PHP Scripting Language

Tags:

I've got an SSL on my e-commerce site and rather than hassle with transferring data to SSL when customers checkout I simply want to run it on https:// all the time.  There isn't much data on the site so it's not going to cause any bad delays.  Therefore, I just want to make sure that anybody that hits the site gets switched over to https:// if they didn't hit it directly.

Also, I've read that in order to help search engines you should decide whether you want to use domain.com or www.domain.com and then add a 301 permanent redirect on the other one.  I want to do that anyway because my SSL is setup for www.domain.com and when you don't include www. you get an SSL warning/error.

I'm trying to do this with my .htaccess file in my web root.  I tried the following on my own:

RewriteEngine On

RewriteCond %{http_host} ^usbswiper.com [nc]
RewriteRule ^(.*)$ https://www.usbswiper.com/$1 [r=301,nc]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

When I do that only the part that takes you to https:// works.  If I type mydomain.com into a browser without www in front of it I get an SSL error (my SSL is for www.domain.com).  

If I use either of those by themselves I get what's expected out of that particular rule.  So if I take the https rule out and leve the other one it will indeed send me to www.domain.com when I don't include the www.

At that point I asked my web host if they could help.  They wound up editing the .htaccess file as follows:

RewriteEngine On

#RewriteCond %{http_host} ^usbswiper.com [nc]
#RewriteRule ^(.*)$ https://www.usbswiper.com/$1 [r=301,nc]
RewriteCond %{HTTPS} off
RewriteRule (.*) https:///www.usbswiper.com/$1 [r=301,nc]

After they did this everything seems to work perfectly for me exactly how I want so I thought all was well.  However, I've started to get numerous complaints that my web site won't load at all for people.  They just get page not found as if the site doesn't exist.  I've heard this from quite a few people since they made that change for me, but again, everything seems to work just fine for me.

In fact, to add some more info, I used to have this site setup within a sub-directory of another domain.  Search engines indexed the pages on that domain and as such that domain still shows up in search results.  I added a PHP 301 redirect into these pages on the previous domain and when people go through that original site they get redirected successfully and the new domain loads correctly.  When they go directly to the site, though, they get page not found.

So something about this .htaccess is screwing things up for only for some people.

Any information on how I can make this work 100% would be greatly appreciated.  Thanks!Start Free Trial
[+][-]07.25.2008 at 01:35AM PDT, ID: 22086832

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 01:49AM PDT, ID: 22086891

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 02:06AM PDT, ID: 22086966

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Apache Web Server, PHP Scripting Language
Tags: PHP
Sign Up Now!
Solution Provided By: snrudda
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628