12
我試圖調整我的htacess文件以跳過重寫規則,如果文件或目錄存在,但是當文件存在時,它將URL更改爲不同的內容。我不知道爲什麼會發生這種情況。這裏是我的htaccess文件:如果文件或目錄存在,RewriteCond跳過規則
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^project/([^/\.]+)/?$ index.php?view=project&project=$1 [L]
RewriteRule ^for/content/ag index.php?view=opening§ion=ag [L]
RewriteRule ^for/content/bus index.php?view=opening§ion=bus [L]
RewriteRule ^for/content/fcs index.php?view=opening§ion=fcs [L]
RewriteRule ^for/content/market index.php?view=opening§ion=market [L]
RewriteRule ^for/content/trade index.php?view=opening§ion=trade [L]
RewriteRule ^for/content/teched index.php?view=opening§ion=teched [L]
RewriteRule ^for/content/([^/\.]+)/?$ index.php?view=content_area§ion=$1 [L]
目錄/項目/ NTI存在,與index.php文件。輸入地址mywebsite.com/folder/project/nti後,它將更改爲mywebsite.com/folder/project/nti/?view=project & project = nti。我將這個應用於測試服務器上的示例站點位於子文件夾中,但實施時,它將位於根Web服務器文件夾中。
感謝您的幫助!