Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- html to php


g1smd - 6:41 pm on Feb 22, 2011 (gmt 0)


Add the
DirectoryIndex index.php directive.

Redirect requests for
/index.php and /index.html to www.example.com/ with a trailing slash.

Link only to
www.example.com/ with a trailing slash within the site.



DirectoryIndex index.php
#
RewriteEngine On
#
# Externally redirect only direct client requests for /index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index.(html?|php)\ HTTP/
RewriteRule ^(([^/]+/)*)index.(html?|php)$ http://www.example.com/$1 [R=301,L]
#
# Externally redirect to canonicalize the domain name if a non-canonical
# hostname is requested, in order to prevent duplicate-content problems
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]


Thread source:: http://www.webmasterworld.com/apache/4270652.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com