开发者

Apache Rewrite Rule Regex Problem

开发者 https://www.devze.com 2022-12-17 12:26 出处:网络
So I have an Apache .htaccess file that contains this: RewriteEngine On RewriteRule ^/(javascript/.*)$ /$1 [L]

So I have an Apache .htaccess file that contains this:

RewriteEngine On
RewriteRule ^/(javascript/.*)$ /$1 [L]
RewriteRule ^/(styles/.*)$ /$1 [L]
RewriteRule ^.*$ /index.php

Unfortunately, the last line's coughing up a 500 error on the server that we've moved the code to. It works fine on my machine, Ubuntu 9.10 running Apache 2.2.12, but not on the server running Apache 2.2.14.

Is there any way to rewrite it so that the server doesn't return that e开发者_运维技巧rror?


The following variations may work

RewriteRule ^/.*$ /index.php
RewriteRule ^.+$ /index.php
RewriteRule ^(.+)$ /index.php
RewriteRule ^/(.*)$ /index.php

I know that this one,

RewriteRule ^(.+)$ /index.php/$1 [L,QSA]

Works well for me on some of my mediawiki sites.

0

精彩评论

暂无评论...
验证码 换一张
取 消