2016-10-27 126 views
0

我沒有關於.htaccess如何工作的信息。我在.htaccess中有下面的腳本。我從live下載的這個web,我需要在本地環境(localhost)上運行它。我有Windows和xampp我已經爲此Web應用程序配置了數據庫,但由於.htaccess的Web應用程序不工作,當我執行應用程序時,它重定向到「http://www.localhost/xampp/」請幫助解決問題,我將非常感謝全部。需要在本地環境中運行Web應用程序

申請地址:http://www.localhost/abc

RewriteEngine on 
RewriteCond %{HTTP_HOST} !^www\. 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 
RewriteBase/ 
##RewriteRule ^index.html$ home [L,NC] 
RewriteRule ^home$ index.php?pageid=91 
RewriteRule ^home$ http://www.example.com/Home 
Redirect /index.html http://www.example.com/home 
RewriteRule ^home$ /index.php?pageid=91 
RewriteRule ^products$ /product-details.php?pageid=92&ID=2 
RewriteRule ^services$ /subpage.php?pageid=94 
RewriteRule ^SOLUTIONS$ /subpage.php?pageid=105 
RewriteRule ^ABOUT-US$ /subpage.php?pageid=113 
RewriteRule ^contact$ /contact.php?pageid=115 
RewriteRule ^contact$ /contact.php?pageid=115&webtolead=1 
RewriteRule ^customer-relationship-management$ /solutions.php?pageid=116 
RewriteRule ^enterprise-mobility-management$ /solutions.php?pageid=117 
RewriteRule ^application-performance-management$ /solutions.php?pageid=118 
RewriteRule ^quantum-mes$ /solutions.php?pageid=129 
RewriteRule ^consulting$ /solutions.php?pageid=119 
RewriteRule ^implementation$ /solutions.php?pageid=120 
RewriteRule ^support$ /solutions.php?pageid=121 
RewriteRule ^Company-Overview$ /subpage.php?pageid=122 
RewriteRule ^President-Message$ /subpage.php?pageid=123 
RewriteRule ^Clients$ /clients.php?pageid=124 
RewriteRule ^News$ /news.php?pageid=125&page=0 
RewriteRule ^Careers$ /careers.php?pageid=126 
RewriteRule ^sitemap$ /sitemap.php?pageid=128 
RewriteRule ^--Pivotal-CRM$ /product-details.php?pageid=92&ID=2 
RewriteRule ^Sugar-CRM$ /product-details.php?pageid=92&ID=3 
RewriteRule ^Airwatch-EMM$ /product-details.php?pageid=92&ID=5 
RewriteRule ^Compuware-APM$ /product-details.php?pageid=92&ID=6 
RewriteRule ^IStorage$ /product-details.php?pageid=92&ID=7 
RewriteRule ^Astute-Solutions$ /product-details.php?pageid=92&ID=9 
RewriteRule ^MS-Dynamics$ http://www.example.com/products 
RewriteRule ^Test-Product$ /product-details.php?pageid=92&ID=10 

RewriteRule ^News-([0-9]+)$ /news-details.php?pageid=125&id=$1 
RewriteRule ^NEWS-([0-9]+)$ /news.php?pageid=125&page=$1 
RewriteRule ^Careers-([0-9]+)$ /job-details.php?pageid=126&id=$1 
RewriteRule ^CAREERS-([0-9]+)$ /job-details.php?pageid=126&page=$1 

<IfModule mod_expires.c> 
ExpiresActive On 
############################################ 
## Add default Expires header 
## http://developer.yahoo.com/performance/rules.html#expires 
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> 
ExpiresDefault "access plus 1 week" 
</FilesMatch> 
</IfModule> 
<IfModule mod_headers.c> 
Header unset ETag 
Header unset Last-Modified 
</IfModule> 
FileETag None 
<FilesMatch "\.(ico|gz|JPG|jpg|jpeg|png|gif|js|css|swf)$"> 
Header unset Cache-control 
Header set Expires "access plus 1 week" 
</FilesMatch> 
+0

您應該更好地編輯標識信息。我不認爲其-dxb.ae會很高興知道你在他們的網站上工作的麻煩。 – Walf

回答

0

重定向發生在2號線和3,如果你刪除它應該消失。

這不是一個編程問題。此外,the documentation for mod_rewrite is readily available.

+0

嗨neuhaus,謝謝你的回覆我刪除了第2行和第3行,現在頁面正在重定向到「http:// localhost/xampp /」,這是錯誤的:( – shaji

+0

在'.htaccess'文件的任何地方都沒有重定向到該URL所以它必須發生在其他地方 – neuhaus

+0

我檢查重定向沒有提到任何其他地方 – shaji

0

改變你的基地,你從服務文件夾匹配:

RewriteBase /abc/ 

註釋掉所有未使用的規則,如額外^home$的。將[L]標誌添加到所有重寫過濾器,以便在第一次匹配時停止處理。

相關問題