Microsoft
Software
Hardware
Network
Question : mod_rewrite single directory to an external domain
Hi,
I'm trying to use the .htaccess file to route incoming traffic to a subdomain for old archived pages. I'm switching to a new format and want all of the old pages that are indexed in Google to still redirect. I've create
http://archives.realvail.c
om
.
I want to route this:
http://www.realvail.com/Re
alNews/848
/Vail-Reso
rts-to-hos
t-
Lindsey-
Vonn-celeb
ration-in-
Vail-Wedne
sday-March
-31.html
to this:
http://archives.realvail.c
om/RealNew
s/848/Vail
-Resorts-t
o-
host-Lin
dsey-Vonn-
celebratio
n-in-Vail-
Wednesday-
March-
31.h
tml
My current htaccess mod rewrite code:
# Rewrite article URLs
RewriteRule ^RealNews/([0-9]+).*$ /articles.php?artid=$1 [NC,L]
I'm using Zend_Router too so this domain currently will go to my homepage unless I can redirect it to archives subdomain.
Thanks for any help.
Answer : mod_rewrite single directory to an external domain
RewriteRule ^(RealNews/([0-9]+).*)$
http://archvies.realvail.c
om/$1
[NC,L
,R=301]
If both sites (www and archives) are on the same vhost, add this rule before the rewriterule:
RewriteCond %{HTTP_HOST} !^archives.realvail.com
Random Solutions
VBA Excel - selecting Control Toolbox/Image
VB.net 32bit&64bit COM Refereces?
The object invoked has disconnected from its clients.
RAID1 in MAX OSx
event ID 39 - 40 -41- 42- 47 winmgmt
Java/J2EE class loading architecture
64-bit version of Acrobat PDF Add-in for Office 2010?
VS2008 - Help with preferences
How do I ensure different backup jobs append to the same tape(s) in a media set through the week Backup Exec 2010?
Change primary smtp addresses for 29 users using powershell for exchange