Mohammed Sufian
Mohammed Sufian

Reputation: 1781

cAjax mod_rewrite not working in codeigniter

i am starting with cjax framework in codeigniter

as explained in the readme file i have setup all the things properly and

my cjax is working great but i wanted to remove the .php part from the url..

from ajax.php?test/test to ajax/test/test for this

i have written the following lines in my .htaccess file

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]

but this is giving me 404 error.. any one please help..

thanks in advance

Upvotes: 1

Views: 81

Answers (1)

anubhava
anubhava

Reputation: 785296

Try these rules:

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]

Upvotes: 1

Related Questions