我有一个网站,我在浏览器中得到了ulr,就像这样: www.abc.com/?i=1我在http://www.freenom.com上注册了域名,他们提供了这样的url。
所以,SEO分析工具说你的网站网址对SEO不友好。
那么,如何让网站网址搜索引擎优化友好使用.htaccess文件。
发布于 2018-03-31 23:05:04
您可以将当前的url格式更改为http://example.com/1,以使其对搜索引擎友好。
要将/?i=1转换为/1,您可以在/.htaccess中使用以下RewriteRule。
RewriteEngine on
# externally redirect from /?i=foobar to /footboar
RewriteCond %{THE_REQUEST} /\?i=([^\s]+) [NC]
RewriteRule ^.*$ /%1? [L,R]
# internally map /footboar to /?i=foobar
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /?i=$1 [L]https://stackoverflow.com/questions/49587595
复制相似问题