Need help in Rewite module

Using a single web hosting account to host multiple sites

Need help in Rewite module

Postby AskSam » Mon Apr 07, 2008 4:27 pm

any one can help to do the following complex (for me :wink: ) rewrite ?

any support domain to specific support domain
e.g.

support.demo-1.com --> support.demo.com
support.demo-2.com --> support.demo.com
support.*.* --> support.demo.com

any www domain into specific www domain
www.*.* --> www.demo.com

any other headers into specific site map
support.demo.com/sitemap

thank in advanced for any help
:)
sam
AskSam
 
Posts: 2
Joined: Mon Apr 07, 2008 4:15 pm

Postby richardk » Wed Apr 09, 2008 1:51 pm

Just support and www?
What happens when you currently go to those sub domains (do they have DNS, do they have document roots)?
What is the document root of support.demo.com?
Do you have access to the httpd.conf file?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby AskSam » Wed Apr 09, 2008 8:01 pm

we have customer with several CN (Common Name)
e.g
demo.com
demo-1.com
demo-...N.com
he point his DNS to specific IP

support.demo.com--> xxx.xxx.xxx.10

the site need lisence and only support.demo.com will works.

so he need to rewrite and redirect ny other domain name excpet support.demo.com to the right one (the site with lisence).

But here the catch the site can works only under SSL

that's mean we already have rewrite that check if not ssl and redirect it to ssl.

---------------
for your question yes we have root access,

again thanks in advanced :wink:
AskSam
 
Posts: 2
Joined: Mon Apr 07, 2008 4:15 pm

Postby richardk » Thu Apr 10, 2008 2:38 pm

we already have rewrite that check if not ssl and redirect it to ssl.

Where is it, a conf file or a .htaccess file? Post it.

Do you have <VirtualHost>s?

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# www.example.com to www.demo.com.
RewriteCond %{HTTP_HOST} ^(www\.)?[^\.]+\.[^\.]+$ [NC]
RewriteRule .* http://www.demo.com%{REQUEST_URI} [R=301,L]

# All other *.example.com to support.demo.com.
RewriteRule .* http://support.demo.com%{REQUEST_URI} [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 5 guests

cron