简单问题:
domain.com应该导致index.php
和domain.com/lala(或任何其他字词)应该导致products.php?name = lala
有人可以给我重写规则吗?
由于
答案 0 :(得分:0)
假设您的网络根.htaccess
目录中有/
个文件
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d # not a dir
RewriteCond %{REQUEST_FILENAME} !-f # not a file
RewriteRule ^(.*)$ products.php?name=$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^ index.php [R=301,L]