Okay this might be little off from programming. But if let's say that I have a website that its url is rewritten from
这可能和编程有点不同。假设我有一个网站它的url被重写了
www.example.com?index.php?id=1&cat=category&title=My-Title
www.example.com index . php ? id = 1只猫=类别标题=我的头衔
to
来
www.example.com/1/category/My-Title
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
它能被搜索引擎搜索为第二个Url吗?例如,如果我输入“category my-title”谷歌将显示
www.example.com/1/category/My-Title
www.example.com/1/category/My-Title
instead of
而不是
www.example.com?index.php?id=1&cat=category&title=My-Title
www.example.com index . php ? id = 1只猫=类别标题=我的头衔
Or is there any necessary code need to be added to htaccess file?
或者有必要的代码需要添加到htaccess文件吗?
3 个解决方案
#1
4
Rewrite and 301 redirect to the new page, but also don't forget to ad the canonical link to the head. In your case:
重写和301重定向到新页面,但也不要忘记将规范链接放到头部。在你的例子:
<link rel="canonical" href="http://www.example.com/1/category/My-Title" />
Also, I advise against using capital letters in urls.
此外,我建议不要在url中使用大写字母。
#2
2
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.
如果需要更改页面的URL,如搜索引擎结果中所示,那么谷歌实际上建议使用服务器端301(永久移动)重定向。
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.
如果同一页面有多个url,您可以使用相同的技术(服务器端301重定向)。然后使用重定向到默认页面。
So in your case www.example.com/1/category/My-Title
will be the URL used by Google search engine.
因此,在你的例子中,www.example.com/1/category/My-Title将是谷歌搜索引擎使用的URL。
Please have a look at Google Webmaster Tools - 301 redirects which explains redirects in greater details.
请查看谷歌网站管理员工具- 301重定向,该重定向可以更详细地解释重定向。
I hope that will help.
我希望这能有所帮助。
#3
0
That is fine. The new URL is the real URL of this page
这是很好。新的URL是这个页面的真实URL
#1
4
Rewrite and 301 redirect to the new page, but also don't forget to ad the canonical link to the head. In your case:
重写和301重定向到新页面,但也不要忘记将规范链接放到头部。在你的例子:
<link rel="canonical" href="http://www.example.com/1/category/My-Title" />
Also, I advise against using capital letters in urls.
此外,我建议不要在url中使用大写字母。
#2
2
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.
如果需要更改页面的URL,如搜索引擎结果中所示,那么谷歌实际上建议使用服务器端301(永久移动)重定向。
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.
如果同一页面有多个url,您可以使用相同的技术(服务器端301重定向)。然后使用重定向到默认页面。
So in your case www.example.com/1/category/My-Title
will be the URL used by Google search engine.
因此,在你的例子中,www.example.com/1/category/My-Title将是谷歌搜索引擎使用的URL。
Please have a look at Google Webmaster Tools - 301 redirects which explains redirects in greater details.
请查看谷歌网站管理员工具- 301重定向,该重定向可以更详细地解释重定向。
I hope that will help.
我希望这能有所帮助。
#3
0
That is fine. The new URL is the real URL of this page
这是很好。新的URL是这个页面的真实URL