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
精彩评论