apache - Redirecting complex URL Aliases in htaccess -
i need redirect sample.com/newdomain/calendar external link have rewrite rule in place redirect sample.com/newdomain/ newdomain.sample.com/ when enter sample.com/newdomain/calendar web browser takes me newdomain.sample.com/calendar. how can override original rewrite have written allow sample.com/newdomain/calendar redirect external url.
the rewrite rule redirect url containing /newdomain is:
# redirect /newdomain newdomain.sample.com rewriterule ^newdomain(/.*)?$ http://newdomain.sample.com$1 [r=301,qsa,l]
any appreciated!
you can place new redirect rule above previous rule , make sure clear browser cache before testing:
rewriteengine on rewriterule ^newdomain/calendar/?$ http://external.site.com/ [r=301,nc,l] rewriterule ^newdomain(/.*)?$ http://newdomain.sample.com$1 [r=301,nc,ne,l]
Comments
Post a Comment