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

+1


a source to share


3 answers


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:



+1


a source


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

+1


a source


Regardless of how this is implemented, make sure any redirects use the 301 HTTP status and not the default (on system systems) 302.

302 = Moved 301 = Moved constantly.

Using a 301 helps google replace the old one with the new url, and it also helps to migrate pages, etc.

0


a source







All Articles