M
M
Mikhail Shatilov2014-06-07 21:18:04
PHP
Mikhail Shatilov, 2014-06-07 21:18:04

How to fix regex in .htaccess?

WikiMedia system, it is necessary that requests come to index.php except css.
Now there is an example, but it doesn't work (Internal Server Error):

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^([^css]*)$ index.php/$1 [L]
</IfModule>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Shatilov, 2014-06-07
@iproger

I found a solution, it seems to work as it should.

<IfModule mod_rewrite.c>
  RewriteEngine On
  #RewriteRule ^([^css]*)$ index.php/$1 [L]
  RewriteBase /
  RewriteCond %{REQUEST_URI} !^/(skins|stylesheets|images|config)/
  RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index|load).php
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question