我需要改变
http://localhost/engineering/management/administrator/modules/course/view.php
到
http://localhost/engineering/course_view.php
我尝试了以下重写
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^engineering/([.*])_([.*])\.php$ /engineering/management/administrator/modules/$1/$2.php
但不影响网址。我认为代码有问题。
最佳答案
我们开始吧:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)_(.*)\.php$ management/administrator/modules/course/view.php
由于您在本地主机和文件夹工程中,您可以在规则中省略它。这仅在您将 .htaccess 放在工程文件夹中时才有效。
http://localhost/engineering/course_view.php
谢谢,
纳吉姆
https://stackoverflow.com/questions/6785818/