Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will Url rewrite with htaccess make website discovered by search engine?

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?

like image 418
user2002495 Avatar asked Feb 12 '13 16:02

user2002495


2 Answers

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.

like image 171
oziri Avatar answered Sep 21 '22 16:09

oziri


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.

like image 31
Tom Avatar answered Sep 19 '22 16:09

Tom