導航:首頁 > IDC知識 > 伺服器rewrite

伺服器rewrite

發布時間:2020-12-31 11:33:40

1、阿里雲伺服器支持URLRewrite嗎

是支持的。
建議用:阿里雲虛擬主機-基礎型(1024M 主機,100M SQL資料庫,千兆共享帶寬),能備案,每年:130元。
希望可以幫到你,在線上。

2、怎麼判斷伺服器是否支持REWRITE模式

如果伺服器滿足下面兩個條件,就支持rewrite偽靜態規則: 1..rewrite目錄的許可權 2.IIS上web 服務擴展里的isapi擴展狀態設為允許。

3、怎麼檢查伺服器iis是否支持 rewrite 兼容性

如果伺服器滿足下面兩個條件,就支持rewrite偽靜態規則:
1..rewrite目錄的許可權
2.IIS上web 服務擴展里的isapi擴展狀態設為允許。

4、請問nginx伺服器的去index.php的rewrite要怎麼寫?

if (!-e $request_filename){rewrite ^/(.*)$ /index.php/$1 last;break;}試過N多種寫法,最終上面這幾行寫法 解決搞定。

5、論壇偽靜態時,怎樣修改伺服器的 Rewrite 規則設置

URL 靜態化復可以提高搜索引擎抓製取,開啟本功能需要對 Web 伺服器增加相應的 Rewrite 支持,且會輕微增加伺服器負擔,請閱讀《用戶使用說明書》中的相關說明。同時您還可以調整每個頁面的靜態格式,但不得刪除其中的 "{xxx}" 標記。注意,修改靜態格式後您需要修改伺服器的 Rewrite 規則設置,當前規則請點擊下面鏈接
查看當前的 Rewrite 規則 !

6、伺服器的rewrite設置??

我沒有,你到bbs.dedecms.com 找 「rewrite」 或者「重寫」 規則看看。我家裡被限制網速了,現在每天都是64K的速度,沒法搜索。。。

7、阿里雲伺服器支持URLRewrite嗎

是支持的。
推薦你用:阿里雲虛擬主機-普及版(1G網頁空間,送50M SQL資料庫,支持HTML/ASP/NET/PHP/MYSQL/MSSQL),需要備案:150元/年。
可以加咱,在線上。

8、怎麼判斷伺服器是否支持REWRITE模式

上傳個偽靜態規則文件試試有沒有效果就知道了。

9、在linux伺服器nginx環境下rewrite規則怎麼寫

nginx虛擬主機配置實例
1、在/usr/local/nginx/conf/nginx.conf文件末尾加入虛擬主機配置,實例如下:

server
{
listen 80;
server_name your_domain_name
index index.html index.htm index.php;
root /wwwroot/your_web_directory

location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}

#include rewite rule file or you can directly write here
include rewrite.conf;

log_format hebaodanscom 『$remote_addr – $remote_user [$time_local] 「$request」 『
『$status $body_bytes_sent 「$http_referer」 『
『」$http_user_agent」 $http_x_forwarded_for』;
access_log /logs/hebaodanscom.log hebaodanscom;
}

2、vi /usr/local/nginx/conf/rewrite.conf 輸入以下規則:

location / {

if (!-e $request_filename)
{

#————START —————WORLDPRESS————
rewrite ^ /index.php last;

#————END —————WORLDPRESS————

#————————zen-cart start——————

# From Ultimate SEO URLs
rewrite "^(.*)-p-(.*).html" /index.php?main_page=proct_info&procts_id=$2&% last;
rewrite "^(.*)-c-(.*).html" /index.php?main_page=index&cPath=$2&% last;
rewrite "^(.*)-m-([0-9]+).html" /index.php?main_page=index&manufacturers_id=$2&% last;
rewrite "^(.*)-pi-([0-9]+).html" /index.php?main_page=popup_image&pID=$2&% last;
rewrite "^(.*)-pr-([0-9]+).html" /index.php?main_page=proct_reviews&procts_id=$2&% last;
rewrite "^(.*)-pri-([0-9]+).html" /index.php?main_page=proct_reviews_info&procts_id=$2&% last;

# For Open Operations Info Manager
rewrite "^(.*)-i-([0-9]+).html" /index.php?main_page=info_manager&pages_id=$2&% last;

# For dreamscape』s News & Articles Manager
rewrite "^news/?" /index.php?main_page=news&% last;
rewrite "^news/rss.xml" /index.php?main_page=news_rss&% last;
rewrite "^news/archive/?" /index.php?main_page=news_archive&% last;
rewrite "^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html" /index.php?main_page=news&date=$1-$2-$3&% last;
rewrite "^news/archive/([0-9]{4})-([0-9]{2}).html" /index.php?main_page=news_archive&date=$1-$2&% last;
rewrite "^news/(.*)-a-([0-9]+)-comments.html" /index.php?main_page=news_comments&article_id=$2&% last;
rewrite "^news/(.*)-a-([0-9]+).html" /index.php?main_page=news_article&article_id=$2&% last;

# All other pages
# Don』t rewrite real files or directories
#RewriteCond %{REQUEST_FILENAME} !-f [NC]
#RewriteCond %{REQUEST_FILENAME} !-d
rewrite "^(.*).html" /index.php?main_page=$1&% last;
#—————————-zen-cart end—————–

}
}

保存後,運行 kill -HUP `cat /usr/local/nginx/nginx.pid` 平滑重啟即可生效。

10、論壇偽靜態時,怎樣修改伺服器的 Rewrite 規則設置

步驟如下:

1. 復制以下代碼(注釋:代碼為伺服器Rewrite 規則)

<Files ~ "^.(htaccess|)$">
deny from all
</Files>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(nankangren.tk)(:80)? [NC]
RewriteRule ^(.*) http://www.nankangren.tk/$1 [R=301,L]
order deny,allow

<IfMole mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+).html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+).html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(w+)-([0-9]+).html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+).html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+).html$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+)-(.+).html$ $1.php?rewrite=$2&%1
</IfMole>

2. 桌面新建TXT文件復制粘貼以上代碼,另存為( .htaccess)文件如下圖:

3. 生成後 ".htaccess"文件使用FTP鏈接工具上傳至伺服器完成修改Rewrite 規則設置

與伺服器rewrite相關的知識