Discussion:
mod_rewrite with Virtual Host and .htaccess - need a clue
(too old to reply)
JPH
2004-06-01 20:34:44 UTC
Permalink
I have the following in my httpd.conf
<VirtualHost *:80>
DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\gumburys.com"
ServerName test.gumburys.com
<Directory / >
Options ExecCGI FollowSymLinks Includes MultiViews
</Directory>
</VirtualHost>

I have only the following in my .htaccess file:
RewriteEngine On
RewriteRule ^(.*).php /cat/list.php?category=$1 [NC,R]

If I go to: http//test.gumburys.com/One.php, I get a 404 - Not Found.

In the Apache access log, I get:
127.0.0.1 - - [01/Jun/2004:16:24:17 -0400] "GET /One.php HTTP/1.1" 404 299

In the Error log, I don't get an error.

The server works fine otherwise. I am coding this on Windows, for upload to
Linux. I have obviously overlooked something. Any clues would be
appreciated.

Thank you,
Josh
JPH
2004-06-01 21:10:49 UTC
Permalink
Also,
LoadModule rewrite_module modules/mod_rewrite.so
is activated.

Josh
Kieran Simkin
2004-06-02 02:15:02 UTC
Permalink
Post by JPH
I have the following in my httpd.conf
<VirtualHost *:80>
DocumentRoot "C:\Program Files\Apache
Group\Apache2\htdocs\gumburys.com"
Post by JPH
ServerName test.gumburys.com
<Directory / >
Options ExecCGI FollowSymLinks Includes MultiViews
</Directory>
</VirtualHost>
RewriteEngine On
RewriteRule ^(.*).php /cat/list.php?category=$1 [NC,R]
Have you got an AllowOverride directive in your httpd.conf?
Post by JPH
If I go to: http//test.gumburys.com/One.php, I get a 404 - Not Found.
127.0.0.1 - - [01/Jun/2004:16:24:17 -0400] "GET /One.php HTTP/1.1" 404 299
In the Error log, I don't get an error.
The server works fine otherwise. I am coding this on Windows, for upload to
Linux. I have obviously overlooked something. Any clues would be
appreciated.
Looks like your .htaccess file is being ignored, which might be because you
haven't enabled them in your httpd.conf.
Post by JPH
Thank you,
Josh
JPH
2004-06-03 20:35:19 UTC
Permalink
Thank you Kieren,
Post by Kieran Simkin
Have you got an AllowOverride directive in your httpd.conf?
I put in AllowOverride All and things have started working. Also, I found
this guide which may be of help to others on Windows:
http://sniptools.com/vault/windows-apache-and-htaccess-authentication.htm#qu
ickwindows

I'm running Windows 2000, so I should only need the following in my
httpd.conf:
JPH
2004-06-03 20:39:31 UTC
Permalink
Thank you Kieran,
Post by Kieran Simkin
Have you got an AllowOverride directive in your httpd.conf?
I added AllowOverride On and that seems to have gotten things working. I
also found this guide which may be of help to others on Windows:
http://sniptools.com/vault/windows-apache-and-htaccess-authentication.htm#qu
ickwindows
Post by Kieran Simkin
Looks like your .htaccess file is being ignored, which might be because you
haven't enabled them in your httpd.conf.
I'm running Windows 2000, so I should only need the following to enable
.htaccess, which was on already:
AccessFileName .htaccess
All the best,
Josh

Loading...