Gramps
Gramps

Reputation: 326

.htaccess URL rewrite fails on Safari / iPad / iOS

So I have an .htaccess URL rewrite rule that works perfectly fine on Firefox, Chrome, etc. on various operating systems. However, on iPad with Safari, it fails with "too many redirects".

An example of the code is:

RewriteEngine On
RewriteRule ^([a-z]+)/([a-z]+)/?$ /index.php?page=$1&subpage=$2
RewriteRule ^([a-z]+)/?$ /index.php?c=$1
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^example.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule .* https://example.com%{REQUEST_URI} [R=301,L]

Any ideas why it only fails on that specific browser and platform? Have already checked the caching in Safari, by the way.

Upvotes: 0

Views: 1208

Answers (1)

Gramps
Gramps

Reputation: 326

Turns out the issue was not with the HTACCESS file but more a redirection on the server itself; which possibly conflicted with the HTACCESS file.

However, as to why it ONLY affected iPad/iPhone with Safari is beyond me.

Upvotes: 1

Related Questions