6
votes

Okay this might be little off from programming. But if let's say that I have a website that its url is rewritten from

www.example.com?index.php?id=1&cat=category&title=My-Title

to

www.example.com/1/category/My-Title

will it be able to be searched as the second Url by search engines? For example, if I type "category my-title" Google will show

www.example.com/1/category/My-Title

instead of

www.example.com?index.php?id=1&cat=category&title=My-Title

Or is there any necessary code need to be added to htaccess file?

3
Just make sure you don't have any links pointing to www.example.com?index.php?id=1&cat=category&title=My-Title and it will work without any problems. - jeroen

3 Answers

4
votes

Rewrite and 301 redirect to the new page, but also don't forget to ad the canonical link to the head. In your case:

<link rel="canonical" href="http://www.example.com/1/category/My-Title" />

Also, I advise against using capital letters in urls.

2
votes

If you need to change the URL of a page as it is shown in search engine results Google actually recommends using server side 301 (Moved Permanently) redirects.

You can use the same technique (server side 301 redirects) if you have multiple URLs to the same page. Then you use the redirect to the default page.

So in your case www.example.com/1/category/My-Title will be the URL used by Google search engine.

Please have a look at Google Webmaster Tools - 301 redirects which explains redirects in greater details.

I hope that will help.

0
votes

That is fine. The new URL is the real URL of this page