301跳轉(zhuǎn),301域名跳轉(zhuǎn),301跳轉(zhuǎn)怎么設(shè)定.htaccess設(shè)置301跳轉(zhuǎn)
新聞 2020-03-26編輯:深圳網(wǎng)站建設(shè)閱讀()標(biāo)簽:
301
301跳轉(zhuǎn)
301跳轉(zhuǎn),301域名跳轉(zhuǎn),301跳轉(zhuǎn)怎么設(shè)定.htaccess設(shè)置301跳轉(zhuǎn),301重定向方法(以ew35.com域名為例)通過.htaccess來實(shí)現(xiàn)網(wǎng)站內(nèi)頁301跳轉(zhuǎn)
如果你的網(wǎng)站根目錄中已經(jīng)存在了.htaccess文件,那么你可以直接修改該文件,然后將規(guī)則添加進(jìn)去,如果你的網(wǎng)站根目錄中不存在.htaccess文件,你可以先自己創(chuàng)建個(gè)htaccess.txt這樣的空文件,然后添加如下規(guī)則,建成后將htaccess.txt文件上傳到網(wǎng)站根目錄,然后將htaccess.txt名修改為.htaccess
ew35.com 301跳轉(zhuǎn)到 www.goalq.com.cn
RewriteEngine on
RewriteCond %{http_host} ^ew35.com$ [NC]
RewriteRule ^(.*)$ http://www.goalq.com.cn/$1 [R=301,L]
www.aaa.com 301跳轉(zhuǎn)到 www.bbb.com
RewriteEngine on
RewriteCond %{http_host} ^www.goalq.com.cn$ [NC]
RewriteRule ^(.*)$ http://www.goalq.com.cn/$1 [R=301,L]
www.goalq.com.cn/bbb.html 301跳轉(zhuǎn)到二級域名 bbb.ew35.com
RewriteEngine on
RewriteCond %{http_host} ^www.goalq.com.cn$ [NC]
RewriteRule ^ew35.html$ http://www.bituiwan.cn/$1 [R=301,L]
www.aaa.com/bbb.html 301跳轉(zhuǎn)到 www.goalq.com.cn/ccc.html
RewriteEngine on
RewriteCond %{http_host} ^www.goalq.com.cn$
RewriteRule ^bbb.html$ http://www.goalq.com.cn/ccc.html$1 [R=301,L]
php偽靜態(tài)怎么設(shè)置301跳轉(zhuǎn)
如果是wordpress設(shè)置的偽靜態(tài)你把跳轉(zhuǎn)代碼放到<IfModule mod_rewrite.c>……</IfModule>之間沒有特殊情況不要去點(diǎn)擊wordpress后臺管理中“設(shè)置->固定鏈接”,因?yàn)橹灰泓c(diǎn)擊了“固定鏈接”,系統(tǒng)會(huì)將<IfModule mod_rewrite.c>……</IfModule>模塊的內(nèi)容初始化,解決辦法就是你可以把代碼放到外面。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{http_host} ^www.goalq.com.cn$
RewriteRule ^56$ http://www.goalq.com.cn/56.html [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>