ali_kiyani Posted August 21, 2008 Share Posted August 21, 2008 Hi, I have a website with two domains: website.com/myfolder website.net/myfolder I want to block access to website.com/myfolder while website.net/myfolder will remain accessible. Similarly website.com and website.net as a whole should be accessible. It's only website.com/myfolder that should be blocked. How do I write .htaccess file? Thanks Link to comment https://forums.phpfreaks.com/topic/120648-please-help-me-write-htaccess-to-block-certain-url/ Share on other sites More sharing options...
ali_kiyani Posted August 21, 2008 Author Share Posted August 21, 2008 Just to clarify that both domains resolve to same website. So whether you open website.com or website.net it will open same website. Link to comment https://forums.phpfreaks.com/topic/120648-please-help-me-write-htaccess-to-block-certain-url/#findComment-621674 Share on other sites More sharing options...
zq29 Posted August 21, 2008 Share Posted August 21, 2008 Off the top of my head, I think it goes something like this... RewriteCond %{HTTP_HOST} ^(www\.)?website\.com$ [NC] RewriteRule ^myfolder$ http://www\.website\.net/myfolder [R=301,L] Link to comment https://forums.phpfreaks.com/topic/120648-please-help-me-write-htaccess-to-block-certain-url/#findComment-622074 Share on other sites More sharing options...
ali_kiyani Posted August 22, 2008 Author Share Posted August 22, 2008 Thanks man will try it. Link to comment https://forums.phpfreaks.com/topic/120648-please-help-me-write-htaccess-to-block-certain-url/#findComment-623154 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.