Bluehost.com Web Hosting $6.95

Rewrite Assistance (Apache 2)

This is a discussion on Rewrite Assistance (Apache 2) within the Linux Web Servers forums, part of the Web Server and Related Forums category; I've been looking at rewrite rules for a couple days, and it's almost starting to make sense. However, ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-23-2005
Dan M
 
Posts: n/a
Default Rewrite Assistance (Apache 2)

I've been looking at rewrite rules for a couple days, and it's almost
starting to make sense. However, my current task has me scratching my head.

Let's say I want to make requests for http://www.catfolks.net load
http://www.p3ts.com/catfolks.html. In my httpd.conf file I've got:

<VirtualHost 66.245.241.124:80>
ServerAdmin (the usual)
DocumentRoot /www/pages/catfolks.net
ServerName www.catfolks.net
ServerAlias catfolks.net
RewriteEngine on
RewriteRule (.*) http://www.p3ts.com/catfolks.html
ErrorLog (the usual)
CustomLog (the usual)
</VirtualHost>

My understanding of rewrite rules make me believe that a request for
anything on catfolks.net (the (.*) part) will get redirected to
http://www.p3ts.com/catfolks.html. What actually happens, though, is that
I load http://www.p3ts.com (the index.html page). What am I
misunderstanding about the rewrite process?

  #2 (permalink)  
Old 11-23-2005
Tim
 
Posts: n/a
Default Re: Rewrite Assistance (Apache 2)

On Tue, 22 Nov 2005 15:16:02 -0800, Dan M sent:

> I've been looking at rewrite rules for a couple days, and it's almost
> starting to make sense. However, my current task has me scratching my
> head.
>
> Let's say I want to make requests for http://www.catfolks.net load
> http://www.p3ts.com/catfolks.html. In my httpd.conf file I've got:
>
> <VirtualHost 66.245.241.124:80>
> ServerAdmin (the usual)
> DocumentRoot /www/pages/catfolks.net
> ServerName www.catfolks.net
> ServerAlias catfolks.net
> RewriteEngine on
> RewriteRule (.*) http://www.p3ts.com/catfolks.html ErrorLog (the usual)
> CustomLog (the usual)
> </VirtualHost>
>
> My understanding of rewrite rules make me believe that a request for
> anything on catfolks.net (the (.*) part) will get redirected to
> http://www.p3ts.com/catfolks.html. What actually happens, though, is that
> I load http://www.p3ts.com (the index.html page). What am I
> misunderstanding about the rewrite process?


I would imagine that requests to www.p3ts.com wouldn't be taken care of by
that VirtualHost block, as it's not one of the server names or aliases it
applies to, so the rewrite rule inside it oughtn't to get applied.
Perhaps you should add it to the aliases.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:50 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0