Re: [users@httpd] mod_rewrite directives problem

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

 



Hi Robert

Thanks for your answer.

I changed the directives according to your input and installed the log.

Apparently the directive RewriteCond %{REQUEST_FILENAME} !-f matches requests for existing files, which it should exactly not do. I try to filter out all requests for non existing documents and folders and lead them to my script, but leave the existing stuff untouched.

Is there a different way to do the filtering for non existing documents (with leaving what has been entered in the Address Bar unchanged)?

Thanks and greetings,
Carole.


Robert Ionescu wrote:
Shyne wrote:
<VirtualHost *:80>
...

   RewriteEngine on
   RewriteCond /help/%(REQUEST_URI) !-d
   RewriteCond /help/%(REQUEST_URI) !-f

   RewriteRule ^help/?(.*)$ /help/index.php?id=$1 [L,QSA]

</VirtualHost>


- I am not sure if /help/%(REQUEST_URI) points to the right place, but

Round parenthesis are wrong, you must use {...}, but consider using

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

- Should it be ^help/ or ^/help/

In per-server context: ^/help/

In order to debug RewriteRules, use a RewriteLog

RewriteLog logs/rewrite
Rewriteloglevel 5



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