I have the following working:
removes the www section from the url if used hides the .php section from the url hides the /parts folder eg:(happylocation.it/parts/anotherpart/this.php into happylocation.it/anotherpart/this.php) Facts:
parts is a real folder/directory anotherpart is a real folder/directory and has all the php files there are no other files in <root> other then index.php there are no files in the parts folder/directory Folder/Directory structure:
<root>/index.php <root>/parts/anotherpart/this.php What .htacces I have running:
Options -Indexes RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www.happylocation.it$ [NC] RewriteRule ^(.*)$ https://happylocation.it/$1 [R=301,L] RewriteCond %{THE_REQUEST} \s/parts/([^\s]+)\s [NC] RewriteRule ^ %1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/parts/$1 -f RewriteRule ^(.+)$ /parts/$1 [L,QSA] RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] RewriteRule ^ %1 [R,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*?)/?$ $1.php [L] The problem is that when browsing to happylocation.it/anotherpart/this it responds with was not found on this server. What I hope to achieve is to have urls like
happylocation.it/anotherpart/this/friendlypageID