Reconfiguring an existing PHP site to rewrite the URL (Pretty URL's)
I currently have a community site that I am running which consists of 15 or so php pages. It is currently not very dynamic, just using php for include / templates.
Currently no content is generated via the query string. The pages don't follow standard naming conventions and there are many inbound links.
I'm looking to deploy a site (and start using query strings to create pages), but before I do that, I want to move on to using pretty urls. With this in mind, I have several questions.
1) Your best bet is to list all requests to the url rewrite page to first catch any request for .php pages and pass them to keep the existing links and then a giant case statement for each of the 15 pages, finally rewrite the url new pages because they will fit the format?
2) How can I prevent duplicates on google after I update my sitemap.xml or delete old pages?
thanks
a source to share
1) I would redirect using apache url rewrite and leave it static. This will avoid the mess of having those 15 files that you already have on your site.
Hope I didn't get your question wrong and it helps.
2) Edit the robots.txt in your site's root directory to tell google (and most others) what it should index and what it shouldn't:
- Google information on the topic: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=40360
- Wikipedia: http://en.wikipedia.org/wiki/Robots_exclusion_standard
- More information: http://www.robotstxt.org/
a source to share
You should use 301 redirects from old pages to new urls. This will redirect users who will follow links from old to new, and Google will transfer the PageRank you have accumulated on old pages to the new one. You can also use Googles' new canonical tag on old pages to ensure that authority is transferred to the new page.
http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html
In .htaccess you want to create a group
redirect 301 / old / old.htm http://www.you.com/new.htm
a source to share