webmail redirection

Discuss practical ways rearrange URLs using mod_rewrite.

webmail redirection

Postby Guest » Mon Oct 04, 2004 2:03 pm

Hi!

I have a server with an entire bunch of domains hosted on it, an I want them all to have webmail.xyz.com pointing to https://www.xyz.com/webmail

this is how far I am:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail\.(.*)
RewriteRule ^(.*)$ https://www.%0/webmail/ [R=301]


But it takes me to webmail.www.xyz.com instead. please help.
Guest
 

Postby seomike » Mon Oct 04, 2004 9:54 pm

RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail\.(.*)\.com$
RewriteRule ^.*$ https://www.%N.com/webmail/ [R=301]

Try this out :)
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas

Postby Guest » Tue Oct 05, 2004 1:26 am

well, that does not quite cut it. the problem is that i want a kind of function. on my server reside one .com domain, one .net-domain, 2 .de-domains, and so on. so, matching against .com is not the way to go, since i want this three-liner to work _for all_ of the domains.

and this one spits out:

www.%n


so, it isnt correct either. my slightly modified RE:

RewriteCond %{HTTP_HOST} ^webmail\.(.*)$
RewriteRule ^.*$ https://www.%0/webmail/ [R=301]
Guest
 

Postby Guest » Tue Oct 05, 2004 2:12 am

well, I thought too complicated:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail\.(.*)$
RewriteRule ^.*$ https://%{SERVER_NAME}/webmail/ [R=301]

thx a lot!
Guest
 


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 104 guests

cron