views:

240

answers:

3

I currently have a community site that I run that is made up of 15 or so php pages. It is not currently very dynamic, only using php for includes/templates.

Currently no content is generated via a query string. The pages do not follow a standard naming convention and there are many inbound links.

I am looking to expand the site (and start using query strings to build pages) but before I do this I want to change over to use pretty url’s. With this in mind I have a few questions though.

1) Is it best to point all requests to a url rewriting page catch any request to .php pages first and pass them through to keep existing links then a giant case statement for each of the 15 pages finally the rewrite the url's of new pages as these will follow a set format?

2) How can I prevent duplicates in google after I have updated my sitemap.xml or will it remove the old pages?

Thanks

+1  A: 

1) I'd redirect using apache's URL rewrite, and leave that static. It'll avoid the mess of having those 15 files you already have in your site.
I hope I have not misunderstood your question and this helps.

2) Edit robots.txt in the root of your website to tell google (and most others) what it should index, and what it shouldn't:

Hugo
Will adding them to robots.txt actually remove the existing entries though?
John
Hugo
A: 

Regardless how its implemented, make sure any redirects use HTTP status 301, not the default (in may systems) of 302.

302 = Moved 301 = Moved permanently.

Using 301 helps google replace the old with the new URL, and should help pagerank etc carry over as well.

benlumley
+1  A: 

You should use a 301 permanent redirect from the old pages to the new URLs. This will redirect users that follow links from the old to the new and Google will pass the PageRank you have accumulated on the old pages to the new one. You might also look at using Googles new canonical tag on the old pages to ensure they transfer authority to the new page.

http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

In .htaccess, you want a bunch of

redirect 301 /old/old.htm http://www.you.com/new.htm

Adam Pope
+1 for the pagerank passing. It can be in .htaccess, or in the apache conf file.
Hugo