2012-10-30 114 views
-2

我想重寫一個目錄到另一個目錄。所有文件的文件/鏈接結構(如css/js/images/GET vars等)必須保持不變。.htaccess重寫完整路徑w /所有文件(不重定向)

我的文件目前都在http://www.example.org/_directory1/output/index.php?site=site1

新的路徑應該是HTTP://www.example。 org/newDir/index.php?site = site1

簡而言之,/ _directory1/output /應該改爲/ newDir /。

+0

我玩了一些W/** RewriteRule^newDir /(.*)$ /var/www/theSite/_directory1/output/index.php?site=$1 [NC] **,但這並沒有影響CSS和js文件。 – secelite

回答

1
RewriteRule http://www.example.org/_directory1/output/$1 ^newDir/(.*)$ [NC] 
0

你會使用

RewriteEngine On 
RewriteBase /newDir/ 
RewriteRule ^(.*)$ http://www.example.org/newDir/$1 
在/ _directory1 /輸出你的.htaccess

/

mod_rewrite文檔還可以幫助你。