.htaccess - Regex rule for URL redirect case and directories -
i looking following url redirect configuration regex:
current url: http://support.olddomain.com/en-us/company/help_files/ab012345 new url: http://support.newdomain.com/articles/cde678910
the problem have case issues , other directories:
support.olddomain.com/en-us/company/help_files/ab012345 - lowercase en_us support.olddomain.com/en-us/company/help_files/ab012345 - capitalized company support.olddomain.com/en-us/company/help_files/ab012345?title=article+title - additional parameters
support.olddomain.com/en-us/company/all_files/ab012345 - on all_files, not hel_files
thus, want redirect url path ab###### proper page on newdomain.com following conditions:
- works http , https
- ignores capitalization
- ignores parameters
- works both all_files , help_files directories.
any welcome. thank you!
i've done in notepad++ ctrl+h
find: ^([\w+\.]+)\/(?=.*ab.*)
replace: newdomain.com/
Comments
Post a Comment