.htaccess - How to 301 Redirect url include particular value -
i want redirect htaccess file url include my_value.aspx main page
for exmple if there url url:
mydomain.com/blablabla/blabla/my_value.aspx
or
mydomain.com/myvalue.aspx?id=3343234&type=blabla
or different way include my_value.aspx redirect 301 http://mydomain.com
how can that?
you can try:
rewriteengine on rewriterule ^(.*)/(.*)/my_value.aspx http://mydomain.com? [l,r=302,nc] rewriterule ^myvalue.aspx http://mydomain.com? [l,r=302,nc]
the above should redirect:
mydomain.com/blablabla/blabla/my_value.aspx mydomain.com/blablabla/blabla/my_value.aspx mydomain.com/myvalue.aspx?id=3343234&type=blabla mydomain.com/myvalue.aspx?id=3343234&type=blabla
to
http://mydomain.com
the nc
flags tells ignore case, mean can use my_value.apsx
or my_value.apsx
or my_value.apsx
, still redirect. change r=302
r=301
when sure redirect works.
Comments
Post a Comment