2011-03-02 95 views
0

我們的商店應用程序位於我們的/store/目錄中,我想將其移至我們的主域。我們在這些網址上有很多鏈接,所以我想在轉移過程中保留它們。ISAPI_Rewrite更改目錄/文件夾。這是正確的嗎?

例如:

http://www.mystore.com/store/hammer.aspx將轉發到的http://www.mystore.com/hammer.aspx新有效的URL。

有時我們的網址在.aspx之後有字符串數據,因此在原始網址中也需要傳輸。

在ISAPI重寫,如果更新我的.htaccess,將這段代碼是正確的:

RewriteCond %{HTTP_HOST} ^www.mystore.com/store$ 
RewriteRule ^(.*) http://www.mystore.com/$1 [L,RP] 

這是正確的嗎?我對/$1語法有點困惑。

回答

0

我建議你解決你的配置(對下ISAPI_Rewrite V3)如下:

RewriteBase/
RewriteCond %{HTTP_HOST} ^www\.mystore\.com$ 
RewriteRule ^store(/.*\.aspx.*) $1 [NC,R=301,L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*\.aspx.*)$ store/$1 [NC,L] 
相關問題