.htaccess Htaccess mod_rewrite:如何将page.php更改为/page?
简单问题: domain.com应该指向index.php 和domain.com/lala(或任何其他单词)应该指向products.php?name=lala 谁能告诉我重写规则吗.htaccess Htaccess mod_rewrite:如何将page.php更改为/page?,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,简单问题: domain.com应该指向index.php 和domain.com/lala(或任何其他单词)应该指向products.php?name=lala 谁能告诉我重写规则吗 谢谢假设您的.htaccess文件位于web根目录/中 RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d # not a dir RewriteCond %{REQUEST_FILENAME} !-f # not a file
谢谢假设您的
.htaccess
文件位于web根目录/
中
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]
你好,谢谢。我收到一个内部服务器错误。里面可能有错误吗?