我希望htaccess
将 example.com/course.php?name=php-advanced 更改为 example.com/course/php-advanced < / p>
另外,将 example.com/contact.php 更改为 example.com/contact
答案 0 :(得分:1)
您可以使用:
RewriteEngine on
RewriteRule ^course/(.*)$ course.php?name=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]