Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

404 redirection... .htaccess?

 
webmaster forum
Activity
0%
 
Regular Coder
Posts: 51
Topics: 3
WWW
April 21, 2010, 05:07:49 AM

Hey guys,

I just wanted to know if there is a way I could do this algorithm. It deals with redirecting a page to a page in a folder of the same name in case of a dead page (404).

1.) If the page loads correctly, do nothing.
2.) If the page has a 404 error in http://www.domain.com/XXXXX, redirect it to http://www.domain.com/forum/XXXXX. XXXXX is often subsituted as $1 from what I know.
3.) if http://www.domain.com/forum/XXXXX is a dead link, redirect it to a 404 page.

Unofficial Rock Band Forums
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
April 22, 2010, 11:50:06 AM

With htaccess you can set up redirections with specific redex rules like redirection sites do or else in htaccess direct 404 to a php page and then via getenv('REQUEST_URI'); get the requesting page name which you can use to redirect to.

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Admin  Offline
*
 
Code Guru
Location: India
Gender: Male
Posts: 1387
Topics: 105
NaviBuster NaviBuster
WWW
May 22, 2010, 08:17:01 AM

Those codes in htaccess file always confuse me lot. Sad
 
webmaster forum
Activity
0%
 
New Coder
Posts: 17
Topics: 2
August 13, 2010, 08:34:13 AM

It’s easy to use htaccess by following some redex rules followed by most of the redirecting websites to generate a name to use for redirecting.

immobilien mallorca | Cheap Website Design | chicago movers
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
August 13, 2010, 04:13:59 PM

Those codes in htaccess file always confuse me lot. Sad

Luckilly there are millions of web pages out there with reference information and example on

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Admin  Offline
*
 
Code Guru
Location: India
Gender: Male
Posts: 1387
Topics: 105
NaviBuster NaviBuster
WWW
August 13, 2010, 08:27:38 PM

@polas: Yes Polas, Internet makes many things simple for us all.
 
webmaster forum
Activity
0%
 
New Coder
Posts: 16
Topics: 1
WWW
March 08, 2011, 09:53:11 PM

It may possible,but I have never tried that as I always use the default 404 page of my CMS      

Go to online money forum to know more about making cash on the net.
View hosting reviews help you choosing a hosting provider.
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page January 26, 2012, 01:56:42 PM