0

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

so I modify the .htaccess add RewriteBase /~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!

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
user916158
  • 34
  • 6

1 Answers1

0

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

Vins
  • 8,849
  • 4
  • 33
  • 53
  • thanks Vins replay , But I have one Project , It's often copy to different host So I have 20+ host , I have to Frequent modify the .htaccess I don't want to hardcode my project , It manage my all code that is Hard How to hardcode modifying the .htaccess , But It can deplay apache userDir ? – user916158 Sep 17 '11 at 02:43