I have a problem with .htaccess, and I am no big expert.
The file structure here is:
cms cms\sites cms\sites\site
Using godaddy (linux delux multihosting) I have www.example.com pointing to 'cms\sites\site'.
If I were browsing the site as a whole url www.mainhosting.com\cms\sites\site - the linkes would work correctly. However using example.com the links would result in a page not found
cms\sites\cite\cms\sites\site\page.php page not found.
These are the .htaccess files I have:
cms
Options -Multiviews (WHEN I TAKE THIS AWAY THE .php extension doesnt get added but no double URL i.e. cms\sites\site\page page not found)
Options -Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !api\\dispatch\.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^api/.* api/dispatch.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
cms\sites & cms\sites\site
Options +FollowSymLinks
Options -Indexes
RewriteEngine On
ErrorDocument 400 /page/error
ErrorDocument 401 /page/error
ErrorDocument 403 /page/error
ErrorDocument 404 /page/error
ErrorDocument 500 /page/error
#ref: http://stackoverflow.com/questions/1698464/mod-rewrite-to-remove-php-but-still-serve-the-php-file
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php