I am about creating a new website; content is classified as article; tag and category
I have folder1 and folder2 which are folders on the remote web server; each of these two folders may contain HTML files
I want that everyone who is browsing my website
1-When he types
www.domin.com/folder1/ -->dispaly the index.html file under the folder1 folder
2-When he types www.domin.com/folder1 --> error
3-When he types
www.domain.com/folder1/file1/
dispaly the /folder1/file1.html file
4-When he types
www.domain.com/folder/file.html or
www.domain.com/folder/file
dispaly an eror: such file does not exist
Actually , what I done is the points: 1, 3
The following .htacces file content (under the public_html folder on the remote web server)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^([^/]+)/$ $1.html
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*[^.]+\.php(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]+/)*[^.]+)\.php$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ http://www.domain.com/$1/ [R=301,L]
#DirectorySlash On
#RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^([^\.]+)$ $1.html [NC,L]
#RewriteRule ^([^\.]+)$ $1.htm [NC,L]
#RewriteRule ^([^\.]+)$ $1.php [NC,L]
I need help to modify my .htaccess file so to be conform with the points 2, and 4
thanks a lot
Try this it should support the 4 rules: