View Full Version : blocking linking urls
joeblack316
Sep 7th 2004, 8:16 am
Hi everyone,
I have this small problem. There is some sneaky bugger who redirecting everyone straight from their site onto ours without our permission. Their just being plain lazy and cant be arsed to build thier own site.. You may ask why is this bad it just means more hits for us.. but unfortunatly we've had so many problems from this person that we just wanna black list him from anything we do. :eek:
Is there a way to block him from redirecting people to our site without having to edit the .htaccess file (cant use this as all our extentions are done in frontpage).
Any help would be appriciated
Cheers
R-)
digitalpoint
Sep 7th 2004, 8:26 am
Have you tried to do it with .htaccess? I'm not so sure that using it actually hurts FrontPage.
minstrel
Sep 7th 2004, 9:04 am
Have you tried to do it with .htaccess? I'm not so sure that using it actually hurts FrontPage.
In most cases, it won't hurt.
However, Frontpage does add an .htaccess file to the root directory on *nix servers -- generally this just hides certain files and directories to protect them. The FrontPage publish routines also hide the .htaccess file from you, presumably because MS doesn't trust you to edit it.
Safest Way
However, you can edit it just fine and safely (I have done so several times): Using a third party FTP program (I'd recommend AceFTP first; WS_FTP second), set it to show hidden files. Then copy .htaccess to your hard drive, edit it by ADDING any lines you need to the bottom of what FP has already placed there, and Microsoft Bob's Your Uncle!
minstrel
Sep 7th 2004, 9:14 am
Incidentally, here's a review (http://www.bandofgonzos.com/2004/08/mother-of-all-htaccess-generators.php) of a nice tool for generating .htaccess statements (http://www.bitesizeinc.net/demo.htaccesser.html).
Or, if you prefer to do it yourself, see the Apache htaccess tutorial (http://httpd.apache.org/docs/howto/htaccess.html).
Redleg
Sep 7th 2004, 11:44 am
I use Frontpage and prevent hotlinking with .htaccess on one of my sites.
But you need to do a couple of things in order to get it working.
First of all backup your existing .htaccess file to your computer.
copy that one (don't overwrite it) and add the code listed below to the bottom of it.
replace yourdomain.com with your domain... :)
upload the new file to your server, and you're "protected" from hotlinking..
But you need to upload the old .htaccess before you publish pages from frontpage again.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://babelfish.altavista.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://babelfish.altavista.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://translate.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://translate.google.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|swf)$ http://www.yourdomain.com/no.jpe [R,NC]
In the "rewriterule" line you can add .htm (or whatever extension he's linking to).
If he tries to link directly to your site from his, the image http://www.yourdomain.com/no.jpe will be displayed instead..
In my case it displays http://www.military-quotes.com/no.jpe, but you can use your imagination and replace it wathever you want to.. ;)
Sneaky, but it works, and it may give you some free advertising for your site as well.. :cool:
minstrel
Sep 7th 2004, 11:57 am
But you need to upload the old .htaccess before you publish pages from frontpage again.
No you don't...
If you append any new lines to the original FrontPage ones, as you have suggested, you should be okay and you should NOT have to upload the original frontPage version to republish -- heck, if I had to do that every day, I'd find another way.
For some sites, FP actually seems to be quite happy even if the original lines are deleted, although I would recommend the safer procedures outlined in this thread.
Redleg
Sep 7th 2004, 12:02 pm
FP refuses to upload new pages if I don't upload the old .htaccess file first..
minstrel
Sep 7th 2004, 1:47 pm
How odd... what version of FP? what is IN your original .htaccess file? what server is it the site on?
I'm on Linux apache server, FP 2002, SE 2002.
My original .htaccess looked like this:
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName <domain here>
AuthUserFile <path to password here>
AuthGroupFile <path to service.grp here>
I then added several lines after it and FP has been happy.
One other question: what did you use to edit the .htaccess file and how did you upload it to the site? If an FTP program, did you ensure that it was uploaded in ascii mode, not binary?
Redleg
Sep 8th 2004, 2:08 am
Linux apache, FP 2002, similar .htaccess file, made in notepad and uploaded in ascii mode (FTP)..
All I did was to add the rewrite code I listed above to the end of the file..
If I try to upload without the old .htaccess file installed FP just tells me that FP extensions haven't been installed on the server.
But it works if I upload the old file again.
It's really no big deal to switch between the two .htaccess files, but it would have been nice to be able to publish the pages without have to use FTP first.
minstrel
Sep 8th 2004, 6:32 am
How very odd... I'm also using FP2002 on Linux Apache and I never have to do that.
What version of the server extensions? Also 2002? I think I'll post this for the mavens in the Microsoft FP group...
Redleg
Sep 8th 2004, 1:15 pm
I've sent you a PM..
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.