php .htaccess clean url


php .htaccess clean url

xxx.com.com/front <<工作雷图恩

Array ( [mod] => home  )

xxx.com/news-my-seo-title <<工作返回

Array ( [mod] => cat [act] => more [seo] => hiburan-2 )

xxx.com/cat-mycategory-1 <<不起作用返回

Array ( [mod] => cat [act] => more [seo] => hiburan-2 )   

我需要返回像

Array ( [mod] => cat [act] => more [seo] => hiburan [page]=> 2 )

我犯了什么错误,因为这是我第一次做首页工作,所以我需要干净的网址

顺便说一下,这是我的.htaccess。

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^front root.php?mod=home [L]
RewriteRule ^/?(news|sch|cat)-([^-].*)$ root.php?mod=$1&act=more&seo=$2 [L]
RewriteRule ^/?(news|sch|cat)-([^-].*)-([0-9]+)$ root.php?mod=$1&act=more&seo=$2&page=$3 [L]
Options All -Indexes
</IfModule>

希望有人可以帮助我,非常感谢,如果有链接或任何我可以阅读的东西,请给我链接。其他信息 我的 SEO 标题格式像这样(破折号分隔)

this-is-seo-title

谢谢之前

您可以使用

.htaccess

Options All -Indexes
RewriteEngine on
RewriteRule ^front root.php?mod=home [L]
RewriteRule ^/?(news|sch|cat)-(.+)-('d+)/?$ root.php?mod=$1&act=more&seo=$2&page=$3 [L]
RewriteRule ^/?(news|sch|cat)-(.+)/?$ root.php?mod=$1&act=more&seo=$2 [L]
无法使用

[^-]*,因为您在 SEO 标题中使用-