Forum Moderators: phranque
RewriteRule ^dir/(.*)\/?$ /dir.html?cat=$1 [L]
The problem is the page is viewable via the following urls:
/dir/WWW
and
/dir/WWW/ (note the end slash)
I want it to permenently behave like the latter, with the slash. Mainly because it can contain more directories, e.g.: /dir/WWW/Forums/
I know I could make the rule as follows:
RewriteRule ^dir/(.*)/$ /dir.html?cat=$1 [L]
This however breaks when Yahoo tries spidering the site, as it stips the end slash!
Has anybody got a work around?
# if no filetype or trailing slash in URI
RewriteCond %{REQUEST_URI} !(\.[a-z0-9]+¦/)$
# add a slash (301 redirect to fix search listings)
RewriteRule (.*) http://www.example.com/$1/ [R-301,L]
#
# Rewrite dir/ requests to dir.html
RewriteRule ^dir/(.+)/$ /dir.html?cat=$1 [L]
Replace the broken pipe "¦" character with a solid pipe before use. Posting on this forum modies pipe characters.
Jim