我正在爭取在我的實時Web服務器上獲得正確的東西。重定向到一個子文件夾,然後在加載index.php時從url中刪除子文件夾
場景:
我最近重新構建我誼項目,允許多個應用程序使用一個項目中的相同的圖像/ DB連接。
"/common" - All images,extensions, models that are shared with the applications.
"/auction" - one of the apps
"/dealernetwork" - another app.
因此,我在「/ var/www/auction」目錄中找到以下應用程序(上述文件夾位於根目錄下)。
什麼,我想這樣做:
我希望去我的域名www.auctionwebsite.co.za,我想它指向我的「拍賣」的應用程序。 「/auction/www/index.php」,然後我想從網址中刪除/拍賣/ www。這樣我的網址就會變成「www.autionwebsite.co.za/index.php/whatever」。
我想在我的apache配置(網站可用)文件中做到這一點,但我沒有任何運氣。我想我的DocumentRoot是「/ var/www/auction」,這樣我就可以返回文件夾「(../../common)」來獲取圖像等。
這是我失敗的一個示例嘗試加載目錄但index.php未被觸發。
<VirtualHost *:50000>
ServerAdmin [email protected]
ServerName www.auctionwebsite.co.za
ServerAlias auctionwebsite.co.za
DocumentRoot /var/www/auction
RewriteEngine On
RewriteRule ^/$ /auction/www [R]
RewriteCond %{REQUEST_URI} !(.*)auction/www
RewriteRule ^(.*)$ $1 [L]
<Directory /auction/www>
#Options Indexes
#allow from all
#order allow, deny
</Directory>
</VirtualHost>
非常感謝。