?
Solved

how to create redirect 301 and change url

Posted on 2008-10-26
1
Medium Priority
?
340 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 1500 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

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 …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

770 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