Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   How do I set up my ht access for redirects? (http://www.greenguysboard.com/board/showthread.php?t=25102)

mrenaud 2005-10-17 11:07 PM

How do I set up my ht access for redirects?
 
I haven't got this figured out yet. I want my 404 traffic redirected back to my root.

the way I have things set up right now when I submit a free site for example the url will be adultpornos.net/freesites/bustybabe/index.html

So the surf can just browse my pics and directory without see my ads which obviously is no good. I had it set up so the directories were hidden but I want to redirect that traffic.

help me out please...
thanks

MeatPounder 2005-10-18 02:39 AM

you can simply add a line in your .htaccess like this

ErrorDocument 404 http://adultpornos.net/

or to redirect basic errors do all these 400's and 500 as I do

ErrorDocument 400 http://adultpornos.net/
ErrorDocument 401 http://adultpornos.net/
ErrorDocument 403 http://adultpornos.net/
ErrorDocument 404 http://adultpornos.net/
ErrorDocument 500 http://adultpornos.net/

another thing you can do is set this to stop anyone from seeing the files in directories with no default page is to add this
Options -Indexes

the minus sign means simply not to show indexes of the files in the subdirectories

cd34 2005-10-18 02:55 AM

Just a quick note, if you do

ErrorDocument 401 http://site.com/

you'll generate errors in the error log as it must be a 'relative' document url

ErrorDocument 401 /path/to.html

is what you want.

MeatPounder 2005-10-18 10:04 AM

ahhh....yes relative path for the 401...glad to know that cd34 as I'm with you guys :)

mrenaud 2005-10-18 01:16 PM

Cool seems to be working ok guys thanks

oast 2005-10-19 08:42 PM

Quote:

Originally Posted by MeatPounder
another thing you can do is set this to stop anyone from seeing the files in directories with no default page is to add this
Options -Indexes

the minus sign means simply not to show indexes of the files in the subdirectories

Or just put an empty index.html file in the folder

Doug E 2006-03-07 06:36 PM

Apologies for bumpin an old thread, but would this be right ?

ErrorDocument 400 /main.html/
ErrorDocument 401 /main.html/
ErrorDocument 403 /main.html/
ErrorDocument 404 /main.html/
ErrorDocument 500 /main.html/

cd34 2006-03-07 06:44 PM

you probably don't want the trailing slash at the end of those unless you actually have a directory called main.html :)

Other than that, make sure that any images loaded on main.html either have a base href, or, are linked with the full path, i.e.



Otherwise when someone goes to

http://yourdomain.com/asdf/asdf/asdf

they'll get broken images.

Doug E 2006-03-08 07:14 AM

kk, i think i got that :)

thanks man


All times are GMT -4. The time now is 03:26 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc