Re: mod_rewrite loaded, but not writing or logging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 20/08/07, Peter Smith <shmooth@xxxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux