daemonkin
01-31-2008, 02:17 PM
Hi guys,
Not too sure about .htaccess but giving it a try:
I want to add '/' to end of address if a directory exists. I have googled some help but get the following:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]
Now I know I have to edit domain.com but do I leave the rest to work its magic? Doing this does make it work and domain.com/dir does not redirect to domain.com/dir/
I have placed the above code in the following:
## production server directives ##
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]
</IfModule>
Any help appreciated
D.
Not too sure about .htaccess but giving it a try:
I want to add '/' to end of address if a directory exists. I have googled some help but get the following:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]
Now I know I have to edit domain.com but do I leave the rest to work its magic? Doing this does make it work and domain.com/dir does not redirect to domain.com/dir/
I have placed the above code in the following:
## production server directives ##
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]
</IfModule>
Any help appreciated
D.