logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: subdomains question
Author
pedroz



Joined: 16 Aug 2007
Posts: 3

PostPosted: Fri 17 Aug '07 18:04    Post subject: subdomains question Reply with quote

part 1: working Smile
-----------------
ErrorDocument 404 http://www.domain.com/error.htm

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com?$
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com$
RewriteRule ^$ /index.php?subdomain=%1 [L]

http://www.domain.com -- no redirection
http://us.domain.com rewrite to http://www.domain.com/index.php?subdomain=us
http://es.domain.com rewrite to http://www.domain.com/index.php?subdomain=es
... and so on


part 2: what I need Question
-----------------------
http://www.domain.com/(*.).htm rewrite to http://www.domain.com/index.php?action=$1
http://us.domain.com/(*.).htm rewrite to http://www.domain.com/index.php?subdomain=us&action=$1
http://es.domain.com/(*.).htm rewrite to http://www.domain.com/index.php?subdomain=es&action=$1

some sort of
http://www.domain.com/register.htm rewrite to http://www.domain.com/index.php?action=register
http://us.domain.com/register.htm rewrite to http://www.domain.com/index.php?subdomain=us&action=register
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Fri 17 Aug '07 18:10    Post subject: pls ask mod_rewrite questions at http://forum.modrewrite.com Reply with quote

There is a forum entirely for mod_rewrite questions at http://forum.modrewrite.com/

This forum is usually the best place to ask mod_rewrite questions like this.

-tom-
Back to top
pedroz



Joined: 16 Aug 2007
Posts: 3

PostPosted: Fri 17 Aug '07 18:12    Post subject: Reply with quote

Thanks Tom.

I will ask there my doubt!

Cheers,
Pedro
Back to top


Reply to topic   Topic: subdomains question View previous topic :: View next topic
Post new topic   Forum Index -> Apache