所以我有一個根文件夾與此,因爲它的.htaccess(這是一個WordPress的版本):mod_rewrite的目錄裏面沒有正確匹配
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
,我已經有了一個叫safetytraining-2的子目錄裏面。請給分目錄做工精細,和我有在safetytraining-2稱爲true.php一個文件,它的內容是這樣的:
<html>
<body>
<?php var_dump($_GET);
?>
</body>
</html>
內safetytraining-2
現在,我有一個是的.htaccess我試圖用mod_rewrite來測試。這是它的內容:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{THE_REQUEST} ^true\.php(.*)$
RewriteRule ^true\.php(.*)$ - [L]
RewriteRule ^(.*)$ true.php?p=$1 [L]
</IfModule>
現在,這裏的問題。當我去website.com/safetytraining-2/foobar我得到這樣的輸出:
array(1) { ["p"]=> string(8) "true.php" }
這真是混亂的廢話了我。我把條件的第一條規則放在試圖阻止apache遞歸應用重寫規則的地方,但我猜測它沒有幫助。無論我在/ safetytraining /之後放置什麼,我都會得到這個輸出。在這裏任何幫助傢伙?您可以在athanclark.com/safetytraining-2上查看該頁面。任何幫助都是極好的!!
您仍在使用Apache 1.x?!?!? –
我必須!我不得不使用蹩腳的網絡託管服務,Windows xampp和使用Apache 1.3><的客戶端 –