Forum Moderators: phranque
# .....................
DirectoryIndex ./php/content.php
# Start your engines
RewriteEngine on
# Set up the paths to follow
Options +FollowSymlinks -Indexes
RewriteBase /
# Enable access to Site Manager
ReWriteRule ^manager$ manager [L]
# Restrict Access to site resources images, etc.
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mysite\.com/.*$ [NC]
RewriteRule \.(gif¦jpe?g¦png¦bmp)$ - [F,NC,L]
RewriteRule ^\.htaccess$ - [F]
# Allow Perl Scripts to run
RewriteRule ^cgi-bin/y/d.cgi/?([a-z]+)-IPP([0-9]+)$ - [NC,L]
# Allow Properly formatted URL to access content
RewriteRule ^([a-z0-9]{5})/([a-z0-9]+)/?$ ./php/content.php [NC,L]
# Allow URL without pagename to access main page and assign default AFF_NUM
ReWriteRule ^([a-z0-9]+)/?$ [mysite.com...] [NC,R=301,L]
# ....................
How would I add a trailing slash to the displayed URL without changing the operation of the rules?
Many thanks for any assistance.
I'm only new to this suff but i think this is what you're after, had a similar problem and jdMorgan helped me out with this code.
# If path does not end in "/"
RewriteCond %{REQUEST_URI}!/$
# and does not contain a "."
RewriteCond %{REQUEST_URI}!\.
# then add trailing slash and redirect
RewriteRule ^(.*) /$1/ [R=301,L]
This will redirect a page like domain.com/page to domain.com/page/
Hope this helps,
Coen