开发者

apache rewrite rules for controller directory

I have controller directory开发者_JAVA技巧 where is controller files located.

I want to do this

sitename.com/test.php

not

sitename.com/controller/test.php

how to rewrite rules with apache?


You'll want to look into mod_rewrite in your .htaccess

Adding a rewrite rule in your .htaccess is simple. First, activate mod_rewrite by adding this line to your .htaccess:

RewriteEngine on
RewriteBase /

Then add your rule to redirect your pages:

RewriteRule ^([^/]+)$ /controller/$1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜