Assistance Needed with Apache Rewrite Rules Causing Loops

My domain
My web server is (include version): apache2
I getting successful https certificate but when checking on browser
it’s showing redirected you too many times.

this usually happens with URL rewrite rules

check if you have a rule that re-writes HTTP to HTTPS and then HTTPS to HTTP

The easiest way would be to paste your Apache Config so others can review it


actually i think it maybe a url rewrite as HTTP portion seems to be fine

maybe you are rewriting with a 301 pointing back to itself which is why i believe you are getting your errors


Is that issue related to .htaccess file?

RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteBase /clouditect_test/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [R=301,L]

Any solution for rewriting pointing back itself

There could also be other rules in the main configuration files of the webserver. Try the commands
$ grep -r RewriteRule .
$ grep -r Redirect .

in the directory which holds the configuration files, usually /etc/apache2 or /usr/local/etc/apache2 (depends on your operating system).

If the redirect loop would be caused by the rules you pasted here, the same issue would be on http, since there is no explicit protocol string.

hi @anuj_9292

No, unfortunately I am not able to provide assistance for two reasons

A) I don’t have enough understanding what those rewrites are there for in the first place and don’t want to be responsible for breaking your system. I am not sure what you role with this system is but you need to find out why they are there.
B) My Apache mod-rewrite skills are not up to the task

Some suggestions (These are provided as is without any warranty etc. If it breaks something you will need to fix it)

A) You can try commenting these out and see if this improves behaviour
B) I have updated the topic so someone with more experience might be able to help. You can also search stack overflow for solutions.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.