Solved

how to create redirect 301 and change url

Posted on 2008-10-26
1
335 Views
Last Modified: 2010-03-04
hello,
I have hosted web site. and all are before in same server.
any hosted web site can before have 2 url :
http://www.domaine.com/<hosted-web-site>/
or
http://<hosted-web-site>/.domaine.com/

and this because i have make this in my conf apache :
---------------------------------------------------------------------------------
RewriteMap              lowercase                               int:tolower
RewriteRule             ^(.*)                                   %{HTTP_HOST}$1  

RewriteCond       /data/www/$1/${lowercase:$2}           -d
RewriteRule       ^www\.([^./]+)\.[^/.]+/([^/]+)(.*)$    /data/www/$1/${lowercase:$2}$3         [L]

RewriteCond       /data/www/$1/${lowercase:$2}           -d
RewriteRule       ^([^/]+)\.[^/.]+/([^/]+)(.*)$         /data/www/$1/${lowercase:$2}$3         [L]

RewriteRule       ^([^/]+)\.([^/.]+)\.[^/]+(.*)$        /data/www/$2/$1$3                [L]
RewriteRule       ^([^./]+)\.[^/.]+(.*)$                 /data/www/$1/www$2               [L]
---------------------------------------------------------------------------------

But now I have move all my www.domaines.com to other server
and all web site I hosted free are hosted in others servers.
this create problem ! and now all url "http://www.domaine.com/<hosted-web-site>/"   not work
normal, because the www is now in other server.

my questions are:
what can I make for solve this problem ?
what make for make 301 redirect but only for hosted web site and not all for all error page ?

cordialy
thierry

0
Comment
Question by:thierry91
1 Comment
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 total points
ID: 22817076
> http://www.domaine.com/<hosted-web-site>/
> what make for make 301 redirect but only for hosted web site and not all for all error page ?

Check, if the first part of an URL-path looks like a http_host

RewriteRule ^/(www\.)?[^.]+\.[a-z]{2,4}(/.*) http://..... [R=301,L]
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
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 …

776 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