当前位置:网站首页>Phpstudy set 301 redirection

Phpstudy set 301 redirection

2022-06-23 06:41:00 Zi Jiao

Yes PHP The degree of familiarity with the environment is far less than IIS,IIS Set in 301 It's simple , Look up the , Discovery use phpStudy Set up 301 So it is easy.


First step : stay phpStudy Option button - Open... In configuration file -httpd-conf. And then the search #LoadModule rewrite_module modules/mod_rewrite.so Delete the preceding #.


The second step : Notepad opens in the root directory of the web site .htaccess Add the following code anywhere :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^369ok.cn [NC]
RewriteRule ^(.*)$ http://www.369ok.cn/$1 [L,R=301]

After the save , restart Apache that will do




remarks : If .htaccess file does not exist , Just create one , as follows :
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^369ok.cn [NC]
RewriteRule ^(.*)$ http://www.369ok.cn/$1 [L,R=301]

</IfModule>


原网站

版权声明
本文为[Zi Jiao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230506340068.html