httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Bray" <nood...@gmail.com>
Subject Re: [users@httpd] mod_rewrite loaded, but not writing or logging
Date Mon, 20 Aug 2007 08:39:11 GMT
On 20/08/07, Peter Smith <shmooth@yahoo.com> wrote:
> At this point, I'll be very happy with any rewriting of any sort - with
> virtual hosts or not - though, I'd eventually like to get it working with
> virtual hosts. Since I've destroyed my config files I'll probably start with
> a brand new Apache install (or at least a new httpd.conf), but here's what
> I've got right now in my httpd.conf in global context:
>
> RewriteEngine on
> RewriteLog c:\temp\rewrite.log
> RewriteLogLevel 7
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ http://cnn.com/ [R=301,L]
>
> The <Directory...> section for document_root is currently in its
> post-install form.
>
> My virtual host entry:
>
>     <VirtualHost *:80>
>
>           ServerName local.songsabout.net
>           DocumentRoot "C:/Program Files/Apache Software
> Foundation/Apache2.2/vhosts/songsabout"
>
>             <Directory "C:/Program Files/Apache Software
> Foundation/Apache2.2/vhosts/songabout">
>                 Options Indexes FollowSymLinks MultiViews
>                 AllowOverride All
>                 Order allow,deny
>                 Allow from all
>             </Directory>
>     </VirtualHost>

That's likely your problem. If you have vhosts, by default mod_rewrite
won't be inherited from the main context. You can fix that by putting:

RewriteEngine On
RewriteOptions Inherit

.. in the vhost, but really you'll be better off putting your rules in
the vhost.

However, if you just want to send 404 requests to an external URL see
ErrorDocument.
 Also, see this page for why matching REQUEST_URI in this context won't work.

http://wiki.apache.org/httpd/RewriteContext


-- 
noodl

---------------------------------------------------------------------
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


Mime
View raw message