.Htaccess editing file

I created the application using CodeIgniter and I tried using the apache mod_rewrite rules listed in the CodeIgniter User Guide as follows

RewriteEngine on

RewriteCond $1 !^(index\.php|images|robots\.txt)

RewriteRule ^(.*)$ /index.php/$1 [L]

The problem is that I have this application in the folder abc/, but when I type mysite/abc/something(which should point to mysite/abc/index.php/something), I get redirected to mysite/index.php/something.

What changes should be made to the file .htaccessfor it to work correctly?

+3
source share
2 answers

Try using the relative path in the lookup:

RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
+1
source
RewriteCond $1 !(index\.php|^images|^robots\.txt)
RewriteRule (.*) index.php/$1 [L,NS]
+3
source

Source: https://habr.com/ru/post/1703644/


All Articles