V
V
Vyacheslav2015-09-03 14:46:11
CodeIgniter
Vyacheslav, 2015-09-03 14:46:11

Why does htaccess RewriteCond ban all pages after the characters in the file?

Hi people!
the essence of the problem, I have an htaccess file that contains:
RewriteEngine on
RewriteCond $1 !^(index\.php|i|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
and I have dynamic linking inside the framework.
those. domain.com/$username
where $username is set by the user himself during registration,
but here's an interesting jamb I found.
Since in htaccess we have a rule for |i|
then all users whose name starts with i* will not be able to get to the page, since they will be redirected via htaccess to the /i*/ folder that does not exist on the server,
respectively, in the config I have
$route['(:any)'] = 'user/index/$1';
How can this be fixed? Thanks in advance
codeigniter 2.2 framework

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav, 2015-09-03
@nskarl

Question removed
Solution:
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteCond %{REQUEST_URI} !^/i/
RewriteRule ^(.*)$ /index.php/$1 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question