You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Lucas, David" <Da...@unh.edu> on 2005/03/09 20:46:53 UTC

[users@httpd] Rewrite question

Hello,

I have a question about rewrite and ssl.

I have the following placed in the httpd.conf:

DocumentRoot "/var/www/html"

RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^10\.10\.131\.[0-9]
RewriteRule (.*) /nec/index.html
RewriteCond %{REMOTE_ADDR} !10\.10\.131\.[0-9]
RewriteRule (.*) /index.html

This seems to be working properly.

Now, what doesn't seem to work is SSL.  I have this in the ssl.conf
file:

DocumentRoot "/var/www/html/secure"

RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^10\.10\.131\.[0-9]
RewriteRule (.*) /nec/index.html
RewriteCond %{REMOTE_ADDR} !10\.10\.131\.[0-9]
RewriteRule (.*) /index.html

And it seems that it is not working.  I get the right page but it
doesn't fully load, like I don't get the pictures and such.  In the log
it says that it can't find the file but it is there and it loads the
index.html file.  What I need to do is to get this to look at the source
IP address and then you load a different page then the default web
server page based on that IP address.  If someone can point me in the
right direction that would greatly help me!!

Thanks!!

Dave

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Rewrite question

Posted by Joshua Slive <js...@gmail.com>.
On Wed, 9 Mar 2005 14:46:53 -0500, Lucas, David <Da...@unh.edu> wrote:
> RewriteEngine on
> RewriteCond %{REMOTE_ADDR} ^10\.10\.131\.[0-9]
> RewriteRule (.*) /nec/index.html
> RewriteCond %{REMOTE_ADDR} !10\.10\.131\.[0-9]
> RewriteRule (.*) /index.html
> 
> This seems to be working properly.

> Now, what doesn't seem to work is SSL.  I have this in the ssl.conf
> file:

[...]

Note there is nothing special about ssl.conf versus httpd.conf.  If
you want something to apply specifically to an ssl-site, you need to
place it into the appropriate <VirtualHost> container.

Your particular configuration has several problems.  For example, it
will rewrite ALL requests.  Perhaps you intend to hit only .html
files, or only requests that have been refered from another site?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org