Basically I have a CDN setup.
/public_html/
index.html
/files/
image/
video/
video2/video2
I want to redirect ALL sub folders and directories to the main folder – except file extensions, so if someone loads a file, I want that to load, just so people cant view directories. (I dont want to see a 404 or forbidden message, just want the directory to go to the main page)
It would save me from uploading index.php redirects. Can this be done with .htaccess?
If you have sub folders, the
(.*)will automatically use it. Example:Here some links that will help you:
http://www.javascriptkit.com/howto/htaccess.shtml
http://www.htaccess-guide.com/
http://net.tutsplus.com/tutorials/other/the-ultimate-guide-to-htaccess-files/
http://www.bloghash.com/2006/11/beginners-guide-to-htaccess-file-with-examples/