Use .htaccess to redirect to subfolder -
i have following documentroot
structure on webserver:
folder1 folder2
i can access of them in standard way
my.ip.address.here/folder1 my.ip.address.here/folder2
i want redirect request website doesn't have particular folder specified 1 default folder, namely 'folder1'. example, if type in browser my.ip.address.here
, redirects me 'my.ip.address.here/folder1'. have .htaccess file located inside documentroot
folder following contents:
rewriteengine on rewriterule ^$ /folder1 [r=301, l]
when run website in browser following eror:
internal server error server encountered internal error or misconfiguration , unable complete request. please contact server administrator, webmaster@localhost , inform them of time error occurred, , might have done may have caused error. more information error may available in server error log.
what wrong configuration? in advance!
if simple want redirect internally or not /
folder2
of these rules would.
redirect 301 using rule:
rewriterule ^$ /folder2 [r=301,l]
internally url not change:
rewriterule ^$ /folder2 [l]
use 302 if want temporary redirect , 301 permanent redirect.
Comments
Post a Comment