|
|
|
||||
|
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. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
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.
__________________
SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean
|
|
|
|
|
|
#2 |
|
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 |
|
|
|
|
|
#3 | |
|
Confirmed User
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
|
Quote:
You didnt read my post. or am i missing something here ?
__________________
SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean
|
|
|
|
|
|
|
#4 |
|
Registered User
Industry Role:
Join Date: Jul 2012
Posts: 47
|
ErrorDocument 404 /index.php
__________________
My porn site |
|
|
|
|
|
#5 |
|
Raise Your Weapon
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 |
|
|
|
|
|
#6 | |
|
Confirmed User
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
|
Quote:
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 |
|
|
|
|