简体   繁体   中英

No .htaccess on root directory but redirects infinitely

I have a website that has only a few .html files. index.html is the main page. Then I have extended this website using CodeIgniter 3. The old site was working on http://example.com/ and the new one was on http://example.com/ci Everything was OK until I tried to do a magic. I decided to leave the new version in ci directory and using .htaccess added a redirect rule:

#.htaccess file on the root (/) directory
Redirect / /ci

It entered into an infinite loop and the page did not open. Then I deleted the line but it stills tries to redirect to /ciciciciciciciciciccici... .

I deleted the .htaccess on the root.

Another .htaccess that resides in the directory /ci has the following lines:

RewriteEngine on
RewriteBase /ci
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

If I enter example.com/ or example.com/ci , the infinite redirect occurs in both circumtances.

Is there anything that I forgot to change? Could this be because of the server's late reaction?

EDIT

Just for testing, I changed the line in the .htaccess in /ci/ directory,

RewriteEngine on
#RewriteBase /ci
RewriteBase /hh # which does not exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

it still tries to redirect to /ci .

EDIT 2

If I enter the full url, it opens the page. For example:

example.com/ci/contact ---> opens
example.com/index.html ---> opens

example.com/           ---> error
example.com/ci         ---> error

example.com/ci/        ---> OPENS! Strange!

It was all about caching, but on the server-side. It is working now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM