Can't open subdirectory with Opencart -
i have problem opening subdirectories. have opencart installed in root of server. have other subdirectories other things scripts , pages. when try open them, custom 404 opencart page. when direct url/subdirectory/index.php or so.
this because of last rewrite rule in .htaccess
file:
rewriterule ^([^?]*) index.php?_route_=$1 [l,qsa]
- redirecting url not containing question mark (?
) opencart router fails route url , falls 404 default page.
for case work have add rewritecond
, test path not contain name of subdirectory(ies).
for example, run scripts in /<oc_root>/my_subdirectory/...
, add condition:
rewritecond %{request_uri} !(my_subdirectory)\/.*
should your_subdir
, his_subdir
, add condition:
rewritecond %{request_uri} !(my_subdirectory|your_subdir|his_subdir)\/.*
make sure last rule goes after condition:
rewritebase / rewriterule ^sitemap.xml$ index.php?route=feed/google_sitemap [l] rewriterule ^googlebase.xml$ index.php?route=feed/google_base [l] rewriterule ^download/(.*) /index.php?route=error/not_found [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !.*\.(ico|gif|jpg|jpeg|png|js|css) rewritecond %{request_uri} !(my_subdirectory|your_subdir|his_subdir)\/.* # <- our new cond rewriterule ^([^?]*) index.php?_route_=$1 [l,qsa]
i didn't test condition hope work.
Comments
Post a Comment