Htaccess how do i ? - Qdoos Webmaster Forum Marketplace
Discussions: 3,494 | Messages: 16,597 | Members: 5,264 | Online: 13 | Newest : BuyBlogComments (Welcome!)

Go Back   Qdoos Webmaster Forum Marketplace > Programming Forum > Programming Discussions > PHP

PHP Discussion area for PHP programming and coding. Ask for help, share your knowledge, or talk about PHP here.


Reply
 
LinkBack Tools Display
Old 06-24-2008, 10:46 PM   #1 (permalink)
Salesman
 
MoneyMan's Avatar
 
Join Date: May 2008
Posts: 87
Rep Power: 1 MoneyMan is on a distinguished road
iTrader: (0)
MoneyMan has no status.

Default Htaccess how do i ?

How do i redirect 404 pages to the homepage using the .htaccess file ? i have recently renewed and renamed some URL's and id would rather people got my homepage than a 404 Error
MoneyMan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 06-25-2008, 01:42 AM   #2 (permalink)
Super Seller
 
Iearn-Money's Avatar
 
Join Date: Jun 2008
Location: Iearn-Money.Com
Posts: 1,093
Rep Power: 3 Iearn-Money will become famous soon enough
iTrader: (2)
Iearn-Money is feeling sorry for somebody special to him
Send a message via MSN to Iearn-Money Send a message via Yahoo to Iearn-Money Send a message via Skype™ to Iearn-Money

Default

Just go to your.htaccess file (or control panel) and type in the following:

Quote:
ErrorDocument 404 /404.php
Change the name "404.php" to whatever the name for your custom error page is.

You might be tempted to type in:

Quote:
ErrorDocument 404 http://www.mysite.com/404.php *WRONG! Results in 200 OK*
But it won't work. Usually it will result in a 200 OK response. Once again, the path must be relative to root or it won't respond with a 404 error code properly.

I think it will work with you!
__________________
- Scriptz-Store.Com : All What You Need To Start Your Own Business (Scripts, Templates, Hostings...)
- Hyips-Rank.Com : Unique HYIP Monitor, High Quality Services
- $100 In prizes | Subscribe to my feed!
Iearn-Money is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-25-2008, 08:15 AM   #3 (permalink)
Im new :)
 
Join Date: Jun 2008
Location: California
Posts: 22
Rep Power: 1 jasonk47 is on a distinguished road
iTrader: (0)
jasonk47 has no status.

Default

Wouldn't that redirect all of his 404 errors to the homepage if he were to use the homepage as his error page? A better solution would be to 301 redirect from the no longer active pages to the new pages:

How to Redirect a Web Page Using a 301 Redirect
jasonk47 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-17-2008, 10:00 AM   #4 (permalink)
Im new :)
 
Join Date: Jul 2008
Posts: 28
Rep Power: 1 sujal is on a distinguished road
iTrader: (0)
Recent Blog:
[CaRP] Failed to open file: 7
sujal has no status.

Default

Htaccess can be used to password-protect directories on your web site. All files and any subdirectories within a directory protected by htaccess will also be protected.
sujal is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-25-2008, 07:10 AM   #5 (permalink)
Im new :)
 
Join Date: Jul 2008
Posts: 6
Rep Power: 1 Dacian is on a distinguished road
iTrader: (0)
Recent Blog:
[CaRP] Failed to open file: 7
Dacian has no status.

Default

The .htaccess file goes in the directory you want to protect.
The passwordfile (allowlist) that you create by running the htpasswd
command should go in your home directory.
Dacian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
htaccess, redirect 404 page

Tools
Display

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
vB.Sponsors

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87