Andy_Kemp Posted September 23, 2015 Share Posted September 23, 2015 Site Structure htdocs/ or www/ or public_html/ | | ==> frontend/ | | | | ==> pages/ | | ==> templates/ | | ==> templates_c/ | | ==> index.php | | ==> backend/ | | | | ==> pages/ | | ==> templates/ | | ==> templates_c/ | | ==> index.php | | ==> ajax/ | ==> cron/ | ==> files/ | ==> includes/ | ==> install/ | ==> languages/ | ==> .htaccess I want to access frontend directory when url is www.site.com not www.site.com/frontend Quote Link to comment https://forums.phpfreaks.com/topic/298289-how-to-access-subdirectory-without-typing-it-to-url/ Share on other sites More sharing options...
QuickOldCar Posted September 23, 2015 Share Posted September 23, 2015 You can not place it in a frontend folder, or do an apache/htaccess rewrite rule Quote Link to comment https://forums.phpfreaks.com/topic/298289-how-to-access-subdirectory-without-typing-it-to-url/#findComment-1521406 Share on other sites More sharing options...
Andy_Kemp Posted September 23, 2015 Author Share Posted September 23, 2015 You can not place it in a frontend folder, or do an apache/htaccess rewrite rule Can you help me with this htaccess rewrite rule. I have tried different rules what i found from internet but none of them worked Quote Link to comment https://forums.phpfreaks.com/topic/298289-how-to-access-subdirectory-without-typing-it-to-url/#findComment-1521407 Share on other sites More sharing options...
QuickOldCar Posted September 23, 2015 Share Posted September 23, 2015 (edited) I don't see why you don't place these files into the root directory | | ==> pages/| | ==> templates/| | ==> templates_c/| | ==> index.php Anyway, make sure mod_rewrite is enabled on the server. Restart apache after making the changes. In .htaccess RewriteEngine On RewriteBase / RewriteRule ^frontend/(.*)$ /$1 [R=301,NC,L] Edited September 23, 2015 by QuickOldCar Quote Link to comment https://forums.phpfreaks.com/topic/298289-how-to-access-subdirectory-without-typing-it-to-url/#findComment-1521408 Share on other sites More sharing options...
Psycho Posted September 23, 2015 Share Posted September 23, 2015 You can also change the 'root' folder for your site. Not knowing what you are using for hosting, I can't give you specific instructions. But, if you are with a host, they should have the ability to configure your domain. Just point the domain to the frontend folder (I assume that none of the files in the backend folder need to be directly accessible via a browser). If you do this, then frontend/ will be the root for your domain and no one would be able to directly access files in backend/ Quote Link to comment https://forums.phpfreaks.com/topic/298289-how-to-access-subdirectory-without-typing-it-to-url/#findComment-1521412 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.