apache - Using .htaccess to redirect to an subdirectory -
i developing rest service , have versioned. have 1 subdomain named api points api folder. have following folder structure:
api |__ v1 |___ public_html |____ .htaccess
at moment can use "http://api.mydomain.com/v1/public_html" (which triggers .htaccess) use version of service.
i have able call "http://api.mydomain.com/v1" instead of previous url. have .htaccess in v1 folder this:
api |__ v1 |___ .htaccess |___ public_html |____ .htaccess
the question should .htaccess contain make redirect ? after redirecting trigger .htaccess public_html ?
i tried use rewriterule ^(/)?$ public_html [l] doesn't work.
edit:
the api folder localized in host home folder (the subdomain points api folder only) :
home |__api |__ v1 |___ public_html |____ .htaccess
try use following source code:
rewriteengine on rewriterule ^$ /v1 [l]
Comments
Post a Comment