Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Keep It Simple, Stupid
 
PerlMonks  

Re: (OT) mod_rewrite anyone?

by clinton (Priest)
on Sep 26, 2009 at 11:02 UTC ( #797675=note: print w/ replies, xml ) Need Help??


in reply to (OT) mod_rewrite anyone?

Firstly, this has nothing to do with Perl.

Secondly, if you look at the docs for apache, you will find a link to the URL rewriting guide, and the second entry Canonical Hostnames explains how you would achieve this.

Clint


Comment on Re: (OT) mod_rewrite anyone?
Re^2: (OT) mod_rewrite anyone?
by mrc (Sexton) on Sep 26, 2009 at 13:07 UTC
    Firstly, this has nothing to do with Perl.
    Hmm :( Regexes are very similar to perl.
      Nice try ;)
Re^2: (OT) mod_rewrite anyone?
by mrc (Sexton) on Sep 26, 2009 at 14:19 UTC
    ...and the second entry Canonical Hostnames explains how you would achieve this.
    Yes but I need a wildcard. I tried something like
    RewriteCond %{HTTP_HOST} !^www\.%1 [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/?(.*) http://www.%1/$1 [L,R,NE]
    but not working. These rules are so hard :(

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://797675]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-04-21 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (491 votes), past polls