.htaccess - Issue trying to redirect old Urls finishing with variables using htaccess -


i have tried redirect old website urls main domain www.my_domain.tld, can't find right solution.

i have 2 kinds of url want redirect main domain:

  • http://www.my_domain.tld/blog/?p=125 ("125" number 1 999)
  • http://www.my_domain.tld/blog/feed/?p=72 ("72" number 1 999)

you can use following rule in /.htaccess :

rewriteengine on   rewritecond %{the_request} /blog/\?p=([0-9]+) [or] rewritecond %{the_request} /blog/feed/\?p=([0-9]+) [nc] rewriterule ^ http://domain.tld? [l,r,nc] 

empty question mark @ end of destination url important discards old query strings.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -