Heim >Backend-Entwicklung >PHP-Tutorial >关于apache服务器rewrite,该如何解决
关于apache服务器rewrite
我的目的是在地址栏输入的url:
http://localhost/project/ShortURL/index.php/149Ui3
自动重写为
http://localhost/project/ShortURL/index.php?controller=jump&method=jemp&code=149Ui3
apache中添加配置如下(apache2.conf):
<br /><IfModule mod_rewrite.c><br /> # Turn on rewrite engine<br /> Options +FollowSymlinks<br /> RewriteEngine on<br /> # More rules below<br /> RewriteRule ^index.php/(.*)$ index.php?controller=jump&method=jump&code=$1 [QSA]<br /></IfModule><br />