php - htaccess rewrite rule to include a string if it is not there -
how can update url htaccess file include string if not there. before site developed in drupal 6 , migrated drupal 7. mobile urls' got changed. example:
http://m.example.com/en/terms-of-use http://m.example.com/en/m-terms-of-use http://m.example.com/en/contact-us http://m.example.com/en/m-contact-us
google indexed previous url's , getting 404 errors. planned auto redirection htaccess.
how can without inter-fairing main site ie. http://example.com
you can use rule:
rewritecond %{http_host} ^m\.example\.com$ [nc] rewriterule ^(en)/((?!m-).+)$ /$1/m-$2 [l,r=301,nc]
Comments
Post a Comment