Use regular expressions in .htaccess for redirections

Task one: Apache server provides a .htaccess file using which you can use to redirect URLs. For example, if you want to redirect all visitors to http://dallascao.com/cn/ to http://dallascao.com/en/, you can open the .htaccess file at the root, and then input: RewriteRule ^cn\/?$ en\/ Translating the code in English, it means “Please replace ‘^cn\/?$’ with [...]

Share