Apache 将ex-ample.com/asdf重定向到example.com/asdf
我想将所有请求从example.com重定向到example.com。url结构应该保持不变,我只想替换域中的Apache 将ex-ample.com/asdf重定向到example.com/asdf,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我想将所有请求从example.com重定向到example.com。url结构应该保持不变,我只想替换域中的 http://www.ex-ample.com/asdf123 redirects to: http://www.example.com/asdf123 谢谢 如果只是一个连字符: RewriteCond %{HTTP_HOST} ^([^-]+)-([^-]+)$ RewriteRule ^ http://%1%2%{REQUEST_URI} [L,R]
http://www.ex-ample.com/asdf123
redirects to:
http://www.example.com/asdf123
谢谢 如果只是一个连字符:
RewriteCond %{HTTP_HOST} ^([^-]+)-([^-]+)$
RewriteRule ^ http://%1%2%{REQUEST_URI} [L,R]