Apache你们怎么做不带www的域名301到带www的啊,.htaccess里面做了301后,就无法验证token了。
微信里点“发现”,扫一下
二维码便可将本文分享至朋友圈。
RedirectMatch 301 ^(.*)$ http://www.your_domain.com
这样?
<IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RedirectMatch 301 ^(.*)$ http://www.my_domain.com # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RedirectMatch 301 ^(.*)$ http://www.my_domain.com # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] </IfModule>
这样???
根治的办法 解析WWW 为什么想着要redirect。如果程序逻辑上必须要求这么做。那就是设计不合理的技术债务,早晚要还
用的默认的.htaccess
站点绑定了带www的和没有带的,就想重定向到一个下面
域名解析配置不行?
同一回复,好了。谢谢各位