Solved

how to create redirect 301 and change url

Posted on 2008-10-26
1
339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

728 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