2014-01-06 25 views
1

不工作我開始用笨cjax框架cAjax mod_rewrite的在笨

的自述文件說明我已經安裝的所有正確的事情,

我cjax是偉大的工作,但我想刪除.php部分來自網址..

ajax.php?test/testajax/test/test這個

我在.htaccess網絡寫了下面的行樂

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-s 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^/?ajax\/(.*)$ /ajax.php?$1 [NC,QSA,L] 
RewriteCond $1 !^(ajax) 
RewriteRule ^(.*)$ index.php?/$1 [L] 

但是這是給我404錯誤..任何一個請幫助..

在此先感謝

+0

這是在唯一代碼你的.htaccess還有更多? – anubhava

+0

這麼多隻有..sir –

回答

1

嘗試下列規則:

RewriteEngine on 
RewriteBase /CIAjax/ 

RewriteRule ^ajax/(.+)$ ajax.php?$1 [NC,QSA,L] 

RewriteCond %{REQUEST_FILENAME} !-s 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L] 
+0

當您嘗試使用您建議的規則的'http:// localhost/CIAjax/ajax/test/test'時遇到404錯誤,並且當http://localhost/CIAjax/ajax.php?test/test '這是工作正常..我想從'ajax.php?test/test'中刪除.php –

+0

這是.htaccess在'DocumentRoot'還是在'/ CIAjax /'中? – anubhava

+0

在'CIAjax'先生 –