Welcome to WebmasterWorld Guest from 54.157.222.62

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

modrewrite and duplicate pages in google

   
9:37 pm on Nov 6, 2012 (gmt 0)



I have a database of content. I use a template file to call details to populate the page

so things like this

domain.com/data.php?id=25

Historically I did use this structure.

I now use htaccess so that I actually call these pages using

domain.com/data/25

All good so far. But google is listing both urls in WMT and giving me a duplicate title error.

So what can I do? I'd like to redirect the former to the latter, but nothing I try seems to work. Any help greatly appreciated.

TIA Jules
thanks all
10:49 pm on Nov 6, 2012 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Well, let's see what you've tried so far. Include details of what "doesn't work" means.
12:00 am on Nov 7, 2012 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



As this is a topic that is asked at least once every week, there's hundreds of prior threads with example code. The last was just days ago.

You summise correctly that you need a redirect and a rewrite for the whole job. Both must be coded using RewriteRules. The devil is in the details.
3:09 am on Nov 7, 2012 (gmt 0)

WebmasterWorld Senior Member vincevincevince is a WebmasterWorld Top Contributor of All Time 10+ Year Member



The key is to end the rewrite rule with the appropriate redirection, e.g. [R=301,L] in this case
6:57 am on Nov 7, 2012 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



There will be two RewriteRules. One is a redirect. One is a rewrite. The second one is already in place, assuming that "now I use htaccess" means "now I rewrite requests for A to serve content from B".