how to NOT modify htaccess run to different userDir in Cakephp

549 Views Asked by At

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!

1

There are 1 best solutions below

1
On

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