开发者

how to NOT modify htaccess run to different userDir in Cakephp

开发者 https://www.devze.com 2023-04-05 15:51 出处:网络
I have apacheuserDir like http://127.0.0.1~/danny so I modify the .htaccessaddRewriteBase开发者_C百科 /~danny/

I have apache userDir like http://127.0.0.1~/danny

so I modify the .htaccess add RewriteBase 开发者_C百科 /~danny/

It's work fine .

But I have many project , I often copy code to different apache userDir

so I Frequent modify the .htaccess

I want to know how to like codeigniter

It's not modify the .htaccess and run anywhere (different userDir )

Any suggestions would be welcomed!


You can do it by modifying the .htaccess file which is located outside app folder. Please try with this. I'm using this particular code and its working for me.

<IfModule mod_rewrite.c>
    RewriteEngine on
    Rewriterule ^your_dir/.*$ - [PT]
    RewriteRule    ^$ app/webroot/    [L]
    RewriteRule    (.*) app/webroot/$1 [L]
</IfModule> 

your_dir Please replace with your directory name.

Now you'll be able to run a directory like this http://example.com/your_dir

0

精彩评论

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