![]() |
|
#1
|
|||
|
|||
Hostname RewriteI'm having some difficulty with rewriting a domain name to another domain.
For example, I want any request to oldsite.mydomain.com to go to newsite.mydomain.com Both oldsite.mydomain.com and newsite.mydomain.com reside on the same server (same apache process actually) but I want to drop oldsite and stick it under a directory on newsite. I'm choosing a rewrite over an alias because I still want requests such as: oldsite.mydomain.com to go to: newsite.mydomain.com Here's what I have been tinkering with... forgive me if I am butchering the rewrite syntax: RewriteCond %{HTTP_HOST} !^oldsite\.mydomain\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) newsite.mydomain.com$1 [L,R] Thanks in advance for any help! |
|
#2
|
||||
|
||||
|
Hello kardon,
Sorry that I cannot post a complete example for your situation but I am having serious problems staying connected to the Net today.... these incompetent, lazy, horrible Malaysian ISPs!!!http://www.desilva.biz/forum/viewtopic617.php <-- is what you could use... of course this .htaccess file goes inside the WWW root of the subdomain, oldsite.example.com. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
Thanks for the help J. I didn't quite get it working yet. I stuck the .htaccess file in the virtual host document root but am getting a 403 error (which is normal b/c I have directory indexing shut off) but I would have thought it wouldn't try to read anything in the directory, just do the redirect.
Is there any way to not have to do this via an htaccess file? That means I'll have to leave the virtual host entry in apache and a directory to hold the .htaccess file. I'd really like to have 1 section within my httpd.conf file that has all these redirects (I actually have about 10 of these to do (oldsite.domain.com => newsite.domain.com/oldsite/). Thanks. |
|
#4
|
||||
|
||||
|
It comes as no surprise that you didn't get it working... my reply yesterday was done under 'duress'
Anyway, today, things look a lot better....On topic: What happens when someone goes to the following 3 urls? 1. http://new.example.com/old/ 2. http://example.com/new/old/ 3. http://www.example.com/new/old/ Are they ending up at the same place? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
A Week in Kuwait by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need rewrite help for cgi script Shop cart | theblade24 | Apache Web Server Forum | 18 | 26-Jan-2004 05:23 |
| Domain to hostname script req. | encoderX | MySQL / PHP Forum | 3 | 20-Dec-2003 18:58 |
| .htaccess language / rewrite problem | spinflip | Apache Web Server Forum | 5 | 15-Dec-2003 14:14 |
| rewrite in Apache2 | lordklloyd | Apache Web Server Forum | 2 | 17-Nov-2003 06:20 |
| Rewrite urls for Mambo | jrobbio | MySQL / PHP Forum | 16 | 24-Jul-2003 03:47 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The