GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Stupid htaccesss question (https://gfy.com/showthread.php?t=413006)

Damian_Maxcash 01-06-2005 10:55 AM

Stupid htaccesss question
 
I have removed all the pages on a domain

I put in an htaccess with 404 handling and it works ok

Unless I go to the root ie. www.domain.com then it goes to the dir listing

I thought it wouldnt find an index page and then go to the 404

What am I doing wrong??

Thanks :)

Sorry for the stupid question

fusionx 01-06-2005 10:59 AM

Quote:

Originally Posted by damian2001
I have removed all the pages on a domain

I put in an htaccess with 404 handling and it works ok

Unless I go to the root ie. www.domain.com then it goes to the dir listing

I thought it wouldnt find an index page and then go to the 404

What am I doing wrong??

Thanks :)

Sorry for the stupid question

It's working as it is supposed to. You are not requesting a document that doesn't exist.

If you really need to, you can redirect anything hitting domain.com to /index.html, which will then trigger the 404.

I'm not sure why you would do this.

Addiction 01-06-2005 10:59 AM

Make an index.php with just this line of code in it.

<?header("Location:http://www.yourdomain.com");?>

some_idiot 01-06-2005 11:10 AM

It's doing this because in your httpd.conf you have it set to allow directory
listings. If you never need directories listed set the global to no. If you do
need directories, then add a line to the virtual host section for no.

list root directory = 200 success, not a 404 not found.

Cheers!

fusionx 01-06-2005 11:10 AM

Quote:

Originally Posted by Addiction
Make an index.php with just this line of code in it.

<?header("Location:http://www.yourdomain.com");?>

Very nice loop!

When it redirects, it will automagically load index.php and send them back to the raw URL.

Damian_Maxcash 01-06-2005 11:17 AM

Thanks guys! :)

Workshop_Willy 01-06-2005 11:28 AM

Quote:

Originally Posted by damian2001
I have removed all the pages on a domain

I put in an htaccess with 404 handling and it works ok

Unless I go to the root ie. www.domain.com then it goes to the dir listing

I thought it wouldnt find an index page and then go to the 404

What am I doing wrong??

Thanks :)

Sorry for the stupid question

No such thing as a stupid question. Lots of good answers in here. Here's another one. As I understand it, you don't want anything other than a 404 appearing when someone hits a directory below your server root, correct? If that's the case, simply chmod all of those subdirectories to "700" and copy your 404 page (assuming it's custom and you want people to see something custom) to the 403 page. The http error message will be 403, but the page will be indentical to your 404. No need to muck around with htaccess then.

Just an option.


All times are GMT -7. The time now is 08:09 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123