我对SEO-PHP有问题。
我有2页:新闻列表页和新闻详细信息页。
但是,从SEO角度来看,如何区分URL中的这两页?
目前,我正在使用这些URL:
我的文件.htaccess代码:
# first parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ index.php?lang=$1 [L]
#
# second parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/$ index.php?lang=$1&page=$2 [L]
#
# third parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ index.php?lang=$1&page=$2¶m=$3 [L]
我的问题是读取第三个参数,因为我不知道这是页码还是新闻标题。
像这样:
# ignore files and directories from all rules below
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# first parameter
RewriteRule ^([^/]+)/$ index.php?lang=$1 [L,QSA]
# second parameter with pagination
RewriteRule ^([^/]+)/page-(\d+)/$ index.php?lang=$1&page=$2 [L,QSA]
# second parameter with title
RewriteRule ^([^/]+)/([^/]+)/$ index.php?lang=$1&title=$2 [L,QSA]
# third parameter
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ index.php?lang=$1&page=$2¶m=$3 [L,QSA]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句