Stupid htaccess question

design

#1

Google is not being a lot of help for me today :frowning:

What would I put in my .htaccess file to redirect all outside access to my site to a certain file?

I have a bunch of directorys such as:
domain.net/blog
domain.net/gallery
domain.net/stuff
etc

and I want to force people to go through my home page.

Thanks :slight_smile:


#2

[quote]What would I put in my .htaccess file to redirect all outside access to my site to a certain file?

and I want to force people to go through my home page.
[/quote]
The easiest thing to do is something like:

.htaccess
SetEnvIf Referer http://www\.mydomain\.com intra_site_referral deny from all allow from intra_site_referral ErrorDocument 403 forbidden.shtml

forbidden.shtml
–[code]

HTTP 403 Forbidden

HTTP 403 Forbidden

Requested URI:

You aren't allowed to see that.

"Outside access" denied.

Please visit home page at: mydomain.com

[/code]--

And just put the .htaccess file in the appropiate directory. Antoher way would be to use the RewriteEngine.

:cool: Perl / MySQL / HTML+CSS


#3

[quote]and I want to force people to go through my home page.

[/quote]

Force doesn’t work on the Web…

http://webtips.dan.info/force.html

Why don’t you want people to be able to link and bookmark specific things in your site that are of interest to them?

– Dan


#4

while I certainly don’t agree with every word (at least to the same degree) that’s a well done article Dan. Very nice.

[color=#0000CC]jason[/color]


#5

I can think of several legitimate reasons to ‘force’ users to pass through an opening page: for example agreeing to terms of service.

Sites dealing with adult content (I’m not talking Pr0n) like a blog on human sexuality or a site discussion birth control options might very well be covered by COPA (the child online protection act) that is being debated in the courts right now. According to COPA, webmasters have to make a strong good-faith effort to ‘protect’ minors from their content… one way is to direct all traffic to an entry page that spells out what’s on the other side and that you have to be 18 to proceed. Coor’s brewery already does it with their website.


#6

I’m with you on the privacy thing, but this topic has the potential of getting very serious. You’re right about age-verification depending on honesty. COPA seems to require that ‘adult’ subject-matter be put behind age verification (which they are legislating as credit card access or digital certificate).

I’ve helped out with a site for a local Planned Parenthood and this could have serious ramifications on how they operate. All joking aside, how many of us have sites that might be ‘harmful to minors’? http://www.eff.org/copa/

Back to the point of the OP: A webmaster can do whatever they want with their own site… their site, their rules. If he wants to use , it’s his right to.

BTW: I clicked on a bunch of those google links and 9 out of 10 that weren’t corporate annual reports, etc. redirected to an age verification page or asked me to relaunch the flash page that age verified me.


#7

What I am trying to do is quite possible Dan.
For a short time I wanted people who had not been throught my main page to go there to read a message.
Generally I encourage/enjoy deep linking but I wanted to make sure everyone who goes to my site is given the chance to read a message. It’s not a TOS/EULA problem, i agree that they do very little in the long run


#8

– Why don’t you want people to be able to link and bookmark specific things in your site that are of interest to them?

It’s a very important – no, essential security issue for dynamic websites, where you don’t just have content, you have program files on the site.