Re: mod_rewrite question - How to avoid Apache's 301 redirect to add trailing slash?

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

 



On 27/02/2008, chengas123 <benjamin.j.mccann@xxxxxxxxx> wrote:
>  Yes, that essentially is exactly what I'd like to do.  However, I'm not sure
>  how to.  I know how to test if the requested resource is a directory, but
>  does anyone have any ideas on how I would test if the rewritten URL is an
>  existing directory?

After your first rule has run subsequent RewriteRules will use the new
version of the request uri. So,

# rules as before

RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1/

.. or something similar. This assumes you're using htaccess.

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