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
Post a Comment