[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[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.6

Redirect (or rewrite) URL with Apache

Asked by mrgordonz in Apache Web Server, Hypertext Transfer Protocol (HTTP)

Tags: Apache, redirect, rewrite

I am trying to configure a rewrite with Apache so that anyone who goes to the root of the site, is redirected to a specific subdirectory.

For example:

Anyone going to

http://my.domain.com

is automatically redirected to

http://my.domain.com/This/Sub/Directory

A couple of important points to note.

1.  All requests, must be rewritten as https
2.  The subdirectory is case sensitive (ie: /this/sub/directory is wrong, but /This/Sub/Directory is correct)
3.  Any requests for a specific resource (ie: something other than the root) should not be redirected, only rewritten as https.  For example, http://my.domain.com/assets/logo.gif should be rewritten as https://my.domain.com/assets/logo.gif, but not redirected at all

I currently have the following directives in httpd.conf to rewrite as https:

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

and this works perfectly.

I had thought that maybe I could simply add another rule like this:

RewriteRule http://my.domain.com http://my.domain.com/This/Sub/Directory

I thought that if I made it the first rule it would handle the redirection, and the next rule would rewrite the request as https.

Alas, it doesn't work.  

I also tried the following:

Alias / /This/Sub/Directory

But that just gave me an error.

I am not sure of the best way to implement this - I don't know if I should be using a redirect or a rewrite.  

This is kind of urgent, so any help is greatly appreciated.

Cheers,

Paul
 
Loading Advertisement...
 
[+][-]05/01/09 12:48 AM, ID: 24277257Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/01/09 01:36 AM, ID: 24277416Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/01/09 04:53 AM, ID: 24278279Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/01/09 05:21 AM, ID: 24278459Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/01/09 05:35 AM, ID: 24278563Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/01/09 05:40 AM, ID: 24278596Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/01/09 05:48 AM, ID: 24278662Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/01/09 06:27 AM, ID: 24279005Accepted Solution

View this solution now by starting your 30-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, Hypertext Transfer Protocol (HTTP)
Tags: Apache, redirect, rewrite
Sign Up Now!
Solution Provided By: caterham_www
Participating Experts: 3
Solution Grade: A
 
[+][-]05/01/09 06:29 AM, ID: 24279021Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/01/09 06:35 AM, ID: 24279091Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/01/09 06:44 AM, ID: 24279208Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/01/09 07:16 AM, ID: 24279613Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/01/09 04:13 PM, ID: 24284035Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/02/09 05:06 AM, ID: 24285874Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625