簡體   English   中英

.htaccess apache 2.2到2.4更新

[英].htaccess apache 2.2 to 2.4 update

我們的主機最近將他們的apache服務器從2.2更新到2.4,現在我們不斷收到500內部服務器錯誤,我們的錯誤日志顯示為“RewriteCond:bad flag delimiters”。

我們的.htAccess文件看起來像這樣。

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/views/.*$ #allows to access views folder and everything in it.
RewriteCond %{REQUEST_URI} !^test.php$ #allows to access views folder and everything in it.
RewriteCond %{REQUEST_URI} !^phonegapFunction.php$ #allows to access views folder and everything in it.
RewriteRule ^([a-zA-Z0-9æøå]*)\/?(\w*)\/?(.*)$ /app.php?team=$1&page=$2&value=$3 [L]

我們的主機說我們需要將.htaccess文件更新為apache 2.4規范,但是我們在這方面遇到了問題,所以希望有人可以提供幫助。

提前致謝

這是我在Apache 2.2和2.4中得到的

使用.htaccess文件,如下所示:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/views/.*$ #allows to access views folder and everything in it.
RewriteCond %{REQUEST_URI} !^test.php$ #allows to access views folder and everything in it.
RewriteCond %{REQUEST_URI} !^phonegapFunction.php$ #allows to access views folder and everything in it.
RewriteRule ^([a-zA-Z0-9æøå]*)\/?(\w*)\/?(.*)$ /app.php?team=$1&page=$2&value=$3 [L]

這是我在錯誤日志中得到的錯誤,對於這兩個版本:

/var/www/localhost/htdocs/.htaccess: RewriteCond: bad flag delimiters

但如果我刪除評論:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/views/.*$ 
RewriteCond %{REQUEST_URI} !^test.php$  
RewriteCond %{REQUEST_URI} !^phonegapFunction.php$
RewriteRule ^([a-zA-Z0-9???]*)\/?(\w*)\/?(.*)$ /app.php?team=$1&page=$2&value=$3 [L]

沒有錯誤,我可以路由到app.php就好了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM