MyBB Community Forums

Full Version: Block subfolder access
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there any way to block subfolder access on a subdomain? For example, I have forums.site.com, I want to be able to redirect site.com/forums/ to the subdomain. I couldn't because of bad redirecting skills, as they're in the same folder and it doesn't make sense. I'm looking for a way and I'm pretty confused on it all.
Are you using cPanel? There's a redirect feature there.
Alternatively, you can change the landing page for site.com/forums/ to site.com/forums/index.php, the index.php file would contain,

<?php

   header( 'Location: http://forums.site.com' ) ;

?>

That's the basics of it.
In site.com/forums/.htaccess (or htaccess.txt), type

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://forums.site.com/$1 [R=301,L]
(2011-07-05, 12:16 AM)Darth Stabro Wrote: [ -> ]In site.com/forums/.htaccess (or htaccess.txt), type

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://forums.site.com/$1 [R=301,L]

I forgot that he was asking to rewrite his domain?

.htaccess
order allow deny
deny from all
allow from <your_IP>
The issue with the .htaccess redirects is that /folder/ and folder.blah.com ARE the same path, so redirecting folder/blah.com to blah.com/folder/ (or vice versa) results in "too many redirects", as it's just looping. Confused