Forum Moderators: phranque

Message Too Old, No Replies

Preventing subdomain folder from being accessed on www site

         

ntbgl

2:44 am on Jul 5, 2009 (gmt 0)

10+ Year Member



I have my public website files stored in a folder called /public_html/

If you go to www.example.com or example.com it will load up the files in /public_html/

I have several sub domains that point to a folder in the /public_html/ folder.

If you go to sub1.example.com or sub2.example.com it will load up the files in /public_html/subdomains/sub1/ and /public_html/subdomains/sub2/

Right now if you go to www.example.com/subdomains/sub1/ or sub2/ it will load the same content as the subdomains. I don't want this.

Can I made an .htaccess file that would prevent the subdomain folder from being accessed from anything with /subdomains/

Thanks

jdMorgan

4:31 pm on Jul 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




RewriteRule ^subdomains/ - [F]

See the resources cited in our Forum Charter for more information.

Jim

g1smd

7:24 pm on Jul 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If the alternative URLs are already indexed, you could set up a 301 redirect to the correct URL for each one. That's what I usually do.