Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果它不匹配,我如何将域 url 重写为特定的域名..
假设我希望它只匹配 example.com 并且访问者来自服务器 ip (http://127.0.0.1/something/else) 或来自另一个域 (http://domain.com/something/else)
我如何重写域名并保留所有其他参数,只是域名到 example.com(结果应该是:http ://example.com/somthing/else )
尝试将这些规则添加到文档根目录中的 htaccess 文件中:
RewriteEngine On RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R]