Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Rewrite .php extension to virtual folder


jabz - 12:12 am on Feb 23, 2010 (gmt 0)


I have made the changes in the REWRITE:

Options +Indexes
Options +FollowSymlinks

RewriteEngine on
RewriteBase /

DirectoryIndex index.php

# REDIRECT Force requests for named index files to drop the index file filename, and force www to avoid redirect chains:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?|php[45]?)(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?|php[45]?)$ http://www.example.com/$1 [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+)/([^\.]+)\.php\ HTTP/
RewriteRule ^(en|de|ar)/([^.]+)\.php$ http://www.example.com/$1/$2 [R=301,L]

# REDIRECT all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

# REWRITE url to filepath
RewriteRule ^([^/]+)/([^/.]+)$ /$1/$2.php [L]


However,...

/en/ -> working
/en/news -> 404
/en/news.php -> redirect to /en/news
/en/news/ -> 404, however, found documents with names similar to the one you requested. Available documents:* /en/news.php

the result does not change. I'm stuck...


Edit: AcceptPathInfo Off -> 500; MultiViews off -> 500

[edited by: jabz at 12:18 am (utc) on Feb 23, 2010]


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