Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-23-2012, 03:01 AM   #1
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
.htaccess masters, Help needed.

hi all.,

how do i do this .,

i want to redirect all error/non existed pages to home page but not using

errodocumnet 404 thing

as it would show 404 in header.,

rather i want header to show
301 redirect.

how do i do that ?

so if i check header for nonexisted page link
like www.blahblah.com/nonexisted.html

it should thorw

HTTP/1.1 301 Moved Permanently

in header.


thanks for your time.
freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-23-2012, 03:28 AM   #2
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
gfy "webmaster forum" lol
2 seconds on Google gets what you need

http://www.htaccessredirect.net/index.php
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-23-2012, 05:12 AM   #3
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
Quote:
Originally Posted by - Jesus Christ - View Post
gfy "webmaster forum" lol
2 seconds on Google gets what you need

http://www.htaccessredirect.net/index.php
seriously?

You didnt read my post.
or am i missing something here ?
freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-23-2012, 05:19 AM   #4
David Petters
Registered User
 
Industry Role:
Join Date: Jul 2012
Posts: 47
ErrorDocument 404 /index.php
__________________
My porn site
David Petters is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-23-2012, 05:27 AM   #5
AdultKing
Raise Your Weapon
 
AdultKing's Avatar
 
Industry Role:
Join Date: Jun 2003
Location: Outback Australia
Posts: 15,601
You might as well use 404, as redirecting many pages back to the home page with 301 will give you no SEO benefit. The idea is to redirect individual old pages to individual new pages, unless you do that the SEO benefit is null.

If you really want to throw a 301 for every page you don't have on your site then do it in Perl or PHP using the guide here:

http://www.seoworkers.com/seo-articl...tml#modrewrite
AdultKing is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-23-2012, 05:31 AM   #6
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
Quote:
Originally Posted by freecartoonporn View Post
seriously?

You didnt read my post.
or am i missing something here ?
I misunderstood becasue you're asking how to do something that is a very bad idea and should not be done, but here's how to redirect if a file does not exist...


Code:
# If requested resource exists as a file or directory, skip next rule
RewriteCond %{DOCUMENT_ROOT}/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/$1 -d
RewriteRule (.*) - [S=1]
#
# Else rewrite requests for non-existent resources to /index.php
RewriteRule (.*) /index.php [R=302,L]

I hacked someone else's code so double check it. I also made it 302 becasue 301 is a really really stupid idea in this situation.
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.