(SEO+htaccess)带有分页和页面详细信息的页面列表


(SEO + htaccess) Page-list with pagination and page-detail

我对SEO-PHP有问题。

我有两个页面:一个新闻列表页面和一个新闻详细信息页面。

但是,从SEO的角度来看,如何在URL中区分这两个页面?

目前,我正在使用以下网址:

  • www.site.com/it/news/page-1/-www.site.com/it/news/page-2/。。。(带页码的新闻列表)
  • www.site.com/it/news/title-news-detail/(新闻详情)

我的文件.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&param=$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&param=$3 [L,QSA]