Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
301 redirect via .htaccess
Old 11-08-2010, 11:38 AM 301 redirect via .htaccess
Skilled Talker

Posts: 57
Name: karim
Trades: 0
I've discovered that we have two identical php files and I'd like to delete one file and point all the links to the same file.

both files have backlinks to them so I don't want to lose seo points.

e.g.

/details.php?id=56
/news2.php?id=56

the file name is the same but the ?id=xx will be the same for both files, I know how to do a 301 for static files, but can someone help me in achieving this for the dynamic files.

Thanks.
__________________

Please login or register to view this content. Registration is FREE
for businesses and dealers
Please login or register to view this content. Registration is FREE
TurboLizard is offline
Reply With Quote
View Public Profile Visit TurboLizard's homepage!
 
 
Register now for full access!
Old 11-08-2010, 03:33 PM Re: 301 redirect via .htaccess
Skilled Talker

Posts: 57
Name: karim
Trades: 0
hi koolguyz

Thanks for taking your time to help, but I have to say as a non programmer I've found the advice you posted very difficult to follow, thanksfully though I've managed to do a php redirect which was a lot easier to pull off than the .htaccess redirect.


PHP Code:
<?php
$location 
="destination url (less id)";
  
header ('HTTP/1.1 301 Moved Permanently');
  
header ('Location: '.$location.$id);
?>
I don't even know php, but the above code made sense to me and I managed to pull it off.

the .id was the variable name of the field with numerical values at the end of the url.
__________________

Please login or register to view this content. Registration is FREE
for businesses and dealers
Please login or register to view this content. Registration is FREE
TurboLizard is offline
Reply With Quote
View Public Profile Visit TurboLizard's homepage!
 
Reply     « Reply to 301 redirect via .htaccess
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.47164 seconds with 12 queries