我有这个文件夹结构,我想将所有请求重定向到索引但忽略 这个文件夹(assets,ajax,testFolder)
index.php
file1.php
file2.php
.htaccess ( im configuring this )
docs
|_doc2
|_doc1
|_.htaccess
assets
|_img
| |_img1.jpg
| |_img2.jpg
|_js
| |_js1.js
| |_js2.js
|_css
|_css1.css
views
|_file1.php
|_file2.php
ajax
|_file1.php
|_file2.php
testFolder
|_file1.php
|_file2.php
|_.ataccess
即时尝试使用此代码但它不起作用,服务器返回错误500.你能帮帮我吗?
RewriteEngine on
RewriteCond %{HTTP_HOST} http://mydomain
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond $1 !^(docs|assets|ajax|testFolder)
RewriteRule ^(.*)$ /index.php [L,R=301]