Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 04-17-2009, 07:53 AM   #1
HyperActive Warrior
War Room Member
 
Join Date: Feb 2004
Location: , , United Kingdom.
Posts: 451
Thanks: 21
Thanked 47 Times in 39 Posts
Default Redirects

Have rebuilt a website that previously had .php extensions, the new site uses wordpress and the page names are for example domain.com/newpage/ the domain name has been retained.

Is it possible to redirect a visitor who tries to access say domain.com/contact.php to domain.com/contact-us/

Have tried a few routes using the htaccess file but can't seem to get it to work.

cheers

Tony
tonyscott is offline   Reply With Quote
Old 04-17-2009, 08:05 AM   #2
Keyboard Warrior
 
Join Date: Apr 2008
Location: , , USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via AIM to angelamh Send a message via MSN to angelamh Send a message via Yahoo to angelamh Send a message via Skype™ to angelamh
Default Re: Redirects

Did you try stripping all of the code from the old php page (including any html) and inserting

<?php
header( 'Location: [insert new url here]' ) ;
?>

You have to do it with a completely blank page... let me know if it works!
angelamh is offline   Reply With Quote
Old 04-17-2009, 08:14 AM   #3
HyperActive Warrior
War Room Member
 
Join Date: Feb 2004
Location: , , United Kingdom.
Posts: 451
Thanks: 21
Thanked 47 Times in 39 Posts
Default Re: Redirects

Hi, thanks for that, might come in useful sometime, but for now, the old pages no longer exist.

Tony
tonyscott is offline   Reply With Quote
Old 04-17-2009, 08:19 AM   #4
Keyboard Warrior
 
Join Date: Apr 2008
Location: , , USA.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via AIM to angelamh Send a message via MSN to angelamh Send a message via Yahoo to angelamh Send a message via Skype™ to angelamh
Default Re: Redirects

Well, you could create a new old page at domain.com/contact.php for the redirect (that's how I tested my response), or did I miss something?
angelamh is offline   Reply With Quote
Old 04-18-2009, 04:41 AM   #5
HyperActive Warrior
War Room Member
 
RedMatrix's Avatar
 
Join Date: Oct 2007
Location: Mission, TX, USA.
Posts: 333
Thanks: 224
Thanked 62 Times in 36 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Yahoo to RedMatrix Send a message via Skype™ to RedMatrix
Default Re: Redirects

You can edit your .htaccess file. Put this line in there:

Code:
Redirect /contact.php http://domain.com/contact-us/

~Dave
RedMatrix is offline   Reply With Quote
Old 04-21-2009, 07:38 AM   #6
HyperActive Warrior
War Room Member
 
Join Date: Feb 2004
Location: , , United Kingdom.
Posts: 451
Thanks: 21
Thanked 47 Times in 39 Posts
Default Re: Redirects

Quote:
Originally Posted by RedMatrix View Post
You can edit your .htaccess file. Put this line in there:

Code:
Redirect /contact.php http://domain.com/contact-us/
Many thanks RedMatrix - that worked

Tony
tonyscott is offline   Reply With Quote
Old 04-21-2009, 10:17 AM   #7
Web Developer
 
wayfarer's Avatar
 
Join Date: Nov 2008
Location: Asheville, NC USA
Posts: 420
Thanks: 18
Thanked 57 Times in 51 Posts
Social Networking View Member's Twitter Profile 
Default Re: Redirects

I recommend you use a 301 response code in addition to the redirect. In .htaccess the above would look like:
Code:
Redirect 301 /contact.php http://domain.com/contact-us/
This tells search spiders and other non-human user agents that the redirect is to the page's new permanent location.

Wayfarer | join me on StoryBlorg
wayfarer is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
redirects

Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 04:46 PM.