Forum Moderators: phranque
RewriteRule ^baby-children$ /wordpress/?page_id=272 [L]
RewriteRule ^info$ /wordpress/?page_id=2416 [L] [error] [client xyz.xyz.xyz.xyz] Directory index forbidden by rule: /home/username/public_html/info/, referer: http://www.watkissonline.co.uk/home The difference between these two entries is that there is no directory for the first, but the second (info) happens to be the name of a directory as well.
RewriteRule ^info/?$ /wordpress/?page_id=2416 [L] It's returning a temp redirect (302), but the browser url still changes to the new page.
Why it's redirecting at all, when you haven't told it to, is a whole nother question.
DirectorySlash Directive
Description:Toggle trailing slash redirects on or off
Syntax:DirectorySlash On|Off
Default:DirectorySlash On
Context:server config, virtual host, directory, .htaccess
Override:Indexes
Status:Base
Module:mod_dir
Compatibility:Available in version 2.0.51 and later
The DirectorySlash directive determines, whether mod_dir should fixup URLs pointing to a directory or not.
Typically if a user requests a resource without a trailing slash, which points to a directory, mod_dir redirects him to the same resource, but with trailing slash
Although not explicitly banned by the HTTP specs it's a good idea to not have page names that are the same as a folder. This protects your sanity.
example.com/somename - as a "page" while also having example.com/somename/ - as a "folder" with files like example.com/somename/filename.png - within it is a big problem. example.com/somename/ - is the URL for the folder and is also the canonical URL for the index page within that folder. example.com/somename/ as a folder while having example.com/somename.html as a page is not such a problem. Be aware that
example.com/somename/ - is the URL for the folder and is also the canonical URL for the index page within that folder.
example.com/folder/index.html and then wonder why they have a Duplicate Content problem. The canonical URL is simply example.com/folder/ here. RewriteRule ^([^/.]+)$ /script.php?param=$1 [L] RewriteRule ^(([^/]+/)*([^/.]+))$ /script.php?param=$1 [L] RewriteCond $1 !-f
RewriteCond $1 !-d
RewriteRule (.*) /script.php?param=$1 [L]