quick redirect question

quick redirect question

Post by Ryan Willia » Mon, 06 Dec 1999 04:00:00



I'm using Apache 1.3 and need to create a RewriteRule that changes a
request for:

http://domain.com

to

http://www.domain.com

I know this is probably a no-brainer for most of you, but I'm a newbie at
this and still don't quite understand regular expressions... yet. Anyway,
I've looked through all the online docs plus a couple of 3rd party books I
have, and I can't find a documented solution to this particular problem.

--
Jimmy Ether
The Anti-Elitist Audio 'Zine
*** Rock is not dead. It's buried underground.
http://subrealsongs.com/antielitist/

 
 
 

quick redirect question

Post by Ryan Willia » Tue, 07 Dec 1999 04:00:00


Thanks for your help. Unfortunately, I'm using an ISP and can't use the
VirtualHost because I don't have server config access. Everything I do
must be through mod_rewrite. I'm hosting multiple domains on the account
using:

Rewri*gine on
RewriteCond   %{HTTP_HOST}                 [^.]+\.domain\.com     [NC]
RewriteRule   !(/[^.]+\.domain\.com)   -                          [C]
RewriteRule   (.*)                         /%{HTTP_HOST}/$1

and in the root www folder:

/www/info.domain.com/www
/www/info.domain.com/cgi-bin
etc.

This all works great, but it has disabled my ISPs default VirtualHost
command which you suggested. So now visitors who go to domain.com without
using the www subdomain get a 403. I was going to use a CGI redirect fix,
but my root cgi-bin is useless due to the first mod_rewrite fix.


>> I'm using Apache 1.3 and need to create a RewriteRule that changes a
>> request for:

>> http://www.veryComputer.com/

>> to

>> http://www.veryComputer.com/

>> I know this is probably a no-brainer for most of you, but I'm a newbie at
>> this and still don't quite understand regular expressions... yet. Anyway,
>> I've looked through all the online docs plus a couple of 3rd party books I
>> have, and I can't find a documented solution to this particular problem.

>Why dont you just redirect e,g

><VirtualHost domain.com>
>ServerName domain.com
>DocumentRoot /path/to/home
>Redirect / http://www.veryComputer.com/
></VirtualHost>

>Easy & Fast

>Hope this helps.


 
 
 

1. I have a Quick Question, need quick answer.

I was looking at a computer.
It uses AMI Bios.
How compatible is AMI Bios with Linux?

Later...
 Dave.
--

--
David Falk          |"People always make the mistake of dismissing as untrue  

                    | their minds cannot readily grasp..." -- Lucius Apuleius
===============================================================================

2. InterNic e-mail?

3. Quick money - quick.mon [01/01]

4. Changing RCS version numbers

5. Apache Redirect/ReWrite for redirecting old->new domains?

6. help !!!--- making dos visible

7. redirect sound card redirected to /dev/null

8. IORESCHECK sound card error

9. .redirect not redirecting to some places

10. : Weird ">" redirect behavior vs. ">>" redirect behavior

11. Port Redirect works but doesn't redirect internal traffic

12. tar question, a quick one!

13. Find - a quick question