apache - cake php htaccess not working(cake2) -


i have cake php app on root , folder on root in have placed placed index.html . dir

root    ---app    ---lib    ---plugins    ---vendors    ---myfolder 

so app url www.example.com . , folder url should www.example.com/myfolder .

my taccess on root

<ifmodule mod_rewrite.c>    rewriteengine on    rewriterule    ^$ app/webroot/    [l]    rewriterule    (.*) app/webroot/$1 [l] </ifmodule> 

but when hit url www.example.com/myfolder showing me error 404 . changed htaccess

<ifmodule mod_rewrite.c>    rewriteengine on     redirectmatch 301 ^/myfolder/(.*)$ http://example.com/myfolder/$1    rewriterule    ^$ app/webroot/    [l]    rewriterule    (.*) app/webroot/$1 [l] </ifmodule> 

update refer 1 how redirect notworking. appriciated

you can try add condition in .htaccess file check if url not contains world don't apply rule try change .htaccess file this:-

<ifmodule mod_rewrite.c>  rewriteengine on  rewritecond %{request_uri} !myfolder  rewriterule    ^$ app/webroot/    [l]  rewritecond %{request_uri} !myfolder  rewriterule    (.*) app/webroot/$1 [l]   </ifmodule> 

hope helpfull.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -