我正在幫助一個網站的朋友,我創建了幾個PHP頁面,然後他複製到根目錄。問題是,htaccess文件的設置方式使得我無法訪問我創建的任何新的php文件,但我可以訪問所有的html文件。我看了很多文檔來編輯htaccess,但是我無法使它工作。任何幫助表示讚賞。我已經添加了新的頁面contact.php,顯示-captcha.php和感謝,you.php訪問新的PHP文件
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [NC]
#RewriteCond %{REMOTE_ADDR} !71\.239\.5\.36
#RewriteCond %{REQUEST_URI} !/maintenance.html$
#RewriteCond %{REQUEST_URI} !/img(.*)$
#RewriteCond %{REQUEST_URI} !/sync/$
#RewriteRule $ /maintenance.html [R=302,L]
##Errors##
ErrorDocument 400 /error.php
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
##Redirect##
RewriteCond %{HTTP_HOST} ^www.example.net [NC]
RewriteRule ^(.*)$ http://example.net/$1 [L,R=301]
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ https://example.net/$1 [R,L]
##Common Files##
RewriteRule ^(.*)\~\57(.*)$ $1Main.php?file=$2 [NC]
RewriteRule ^(.*)ajax\57(.*)$ $1Main.php?ajax&$2 [NC]
RewriteRule ^(.*)sync\57(.*)$ $1Main.php?sync&$2 [NC]
RewriteRule ^(.*)backup\57(.*)$ $1Main.php?backup&$2 [NC]
RewriteRule ^(.*)SampleDoc(\57)(.*[^\57])(\57?)$ $1index.php?count=$3 [NC]
##REDIRECTS##
RewriteRule ^(.*)menu(\57)(.*[^\57])(\57)(.*[^\57])$ $1menu.php [NC]
RewriteRule ^(.*)menu(\57)(.*[^\57])(\57?)$ $1menu.php [NC]
RewriteRule ^(.*)menu(\57?)$ $1menu.php [NC]
RewriteRule ^(.*)checkout(\57)(.*[^\57])(\57)(.*[^\57])$ $1checkout.php [NC]
RewriteRule ^(.*)checkout(\57)(.*[^\57])(\57?)$ $1checkout.php [NC]
RewriteRule ^(.*)checkout(\57?)$ $1checkout.php [NC]
RewriteRule ^(.*)ThankYou(\57)(.*[^\57])(\57?)$ $1ThankYou.php?$3 [NC]
RewriteRule ^(.*)ThankYou(\57?)$ $1ThankYou.php [NC]
RewriteRule ^(.*)Contact(\57)(.*[^\57])(\57?)$ $1contact.php?$3 [NC]
RewriteRule ^(.*)Contact(\57?)$ $1contact.php [NC]
RewriteRule ^(.*)account(\57)(.*[^\57])(\57)(.*[^\57])(\57)(.*[^\57])$ $1account.php?type=$3&email=$5&code=$7 [NC]
RewriteRule ^(.*)account(\57)(.*[^\57])(\57?)$ $1account.php?type=$3 [NC]
RewriteRule ^(.*)account(\57?)$ $1account.php [NC]
RewriteRule ^(.*)catering(\57)(.*[^\57])(\57)(.*[^\57])$ $1catering.php?$3$5 [NC]
RewriteRule ^(.*)catering(\57)(.*[^\57])(\57?)$ $1catering.php?$3 [NC]
RewriteRule ^(.*)catering(\57?)$ $1catering.php [NC]
RewriteRule ^(.*)changepassword\57(.*[^\57])\57(.*[^\57])$ $1account.php?type=changepssd&email=$2&code=$3 [NC]
RewriteRule ^(.*)join(\57)(.*[^\57])(\57)(.*[^\57])$ $1account.php?type=join&email=$5&code=$7 [NC]
我試圖添加contact.php但你可以看到它沒有幫助。
你如何試圖訪問新的PHP文件?什麼是您使用的URL? –
www.sample.net/contact.php並且該頁面包含文件require_once(「./include/fgcontactform.php」); require_once(「./ include/captcha-creator.php」); require_once 我有www.sample.net/menu.php使用上述文件 – Vinit
我在瀏覽器中檢查了檢查器,它所說的全部是500錯誤 – Vinit