Solved

Apache Rewrite rule

Posted on 2011-09-12
6
259 Views
Last Modified: 2012-06-27
I want to have exchange.com be a redirect to the homepage of solution.com, but would it be possible to have exchange.com/savings be a redirect to the savings page? Or possibly savings.adhdtreatmentinfo.com?. If possible what would be the rewrite rule.
0
Comment
Question by:udaybobbala
6 Comments
 
LVL 4

Expert Comment

by:vvk
ID: 36525419
you probably need to use Redirect or RedirectMatch since it looks like you're using different server. or is solution.com content exist on the same server? then it'll not be going to solution.com through rewrite it'll just fetch content from different location
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36525445
Your question is not very clear.

Are you saying that you want:
http://exchange.com redirect to http://solution.com
and
http://exchange.com/savings redirect to http://savings.adhdtreatmentinfo.com

?
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36525456
You might try this:

# I want to have exchange.com be a redirect to the homepage of solution.com
RewriteCond %{HTTP_HOST} exchange.com$
RewriteCond %{REQUEST_URI} ^/?$
RewriteRule .* www.solution.com

# would it be possible to have exchange.com/savings be a redirect to the savings page? Or possibly savings.adhdtreatmentinfo.com
RewriteCond %{HTTP_HOST} exchange.com$
RewriteCond %{REQUEST_URI} ^/savings$
RewriteRule (.*) $1.adhdtreatmentinfo.com

Open in new window

0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:udaybobbala
ID: 36525804
I am sorry small modification in the question.


http://exchange.com redirect to http://solution.com
and
http://exchange.com/savings redirect to http://savings.exchange.com

All the pages of exchange.com should be redirected to solution.com home page except one sub page exchange.com/savings redirected to the savings page of exchange.com ( http://savings.exchange.com)
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 300 total points
ID: 36525844
So...
# except one sub page exchange.com/savings redirected to the savings page of exchange.com
RewriteCond %{HTTP_HOST} exchange.com$
RewriteRule ^(savings)(/.*) $1.exchange.com$2 [L]

# All the pages of exchange.com should be redirected to solution.com home page
RewriteCond %{HTTP_HOST} exchange.com$
RewriteRule (.*) www.solution.com/$1

Open in new window

0
 

Author Closing Comment

by:udaybobbala
ID: 36529714
I still need to test it in integration.

Thanks for your fast reply.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Redirect URL's containing question marks 5 74
How to redirect https://www to non-www? 6 76
setting up tomcat for external access 4 75
linux apache localhost dev laptop 5 52
In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question