homepage Welcome to WebmasterWorld Guest from 107.22.78.233
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
changing dynamic urls
how to retain existing pagerank?
showtime




msg:3410488
 2:32 pm on Aug 1, 2007 (gmt 0)

hi;

i have over 20000 dynamic pages about soccer statistics. Now our urls like below:

www.mydomain.com/soccer-stats/competitions.php?competition=28

My programmer will make them SEF url's like below:

www.mydomain.com/soccer-stats/c/sweden/allsvenskan/

But we use the old tecnique for a long time and my pages have pagerank. How can i protect current pagerank and change the urls to SEF url?

How can i redirect all pages?

Thanks

Anil

 

jdMorgan




msg:3410610
 4:14 pm on Aug 1, 2007 (gmt 0)

It will be necessary to do one of two things, in addition to the SEF changes to the script:

1) If the request from the client is for an old dynamic URL, use RewriteMap in httpd.conf (or conf.d) to call a script to take the old dynamic URL, access the database, and retrieve the new static URL. Then generate a 301-Moved Permanently redirect to the new static URL.

2) If the request from the client is for an old dynamic URL, use mod_rewrite in httpd.conf, conf.d, or .htaccess to call a script that accesses the database, retrieves the new static URL, and then generates a 301-Moved Permanently redirect to the new static URL.

Either way will work. What is critical is that 'infinite' rewrite/redirection loops must be avoided. The way to do this is to use RewriteCond examining the server variable THE_REQUEST to be sure that requests for old dynamic URLs are coming direct from the client, and are not being requested as a result of the internal rewriting of the new static URLs.

In other words, the process looks like this:

1) Script puts new static links on the page.
2) Client requests a new static URL as the result of a click on one of these static links on the page.
3) Mod_rewrite or AcceptPathInfo is used to deliver this request to your script.
4) Script produces next page.
5) If a request for an old dyamic URL is received from client, redirect to the new static URL. This must be done without creating a loop due to interaction with step 3.

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved