LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2015, 05:50 PM   #1
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Rep: Reputation: Disabled
httpd 2.4 "Error too many redirects" when accessing web page


If I try to access my web page via a web browser I get something similar to "Error too many redirects". I have a few rewrite rules, such as to force https and force anyone that tries to type www. to just make it go to my domain. This used to work fine on httpd 2.2 but on 2.4 it is giving me some problems.

RewriteEngine on
RewriteCond {HTTPS} off
RewriteRule (.*) https://{HTTP_HOST}:443%{REQUEST_URI}
Redirect permanent / https://mydomain.com/

These options redirect HTTP to HTTPS and forces non-www

Last edited by Altiris; 08-01-2015 at 10:24 PM.
 
Old 08-02-2015, 08:03 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,098
Blog Entries: 1

Rep: Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989Reputation: 1989
Use another set of rewrite condition/rule for the not-www redirect:
Code:
RewriteCond %{HTTP_HOST} !^mydomain.com/
RewriteRule (.*) http://mydomain.com/$1 [R=301,L]
to avoid loops
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php "system"-call to access tty port, "error accessing" wedz Linux - Software 3 05-22-2012 07:34 PM
access web page after wifi connection "auto magic" SaintDanBert Linux - Networking 1 01-13-2012 05:19 PM
Java code to implement "wget" to save a web page in linux Kakarot_Rathish Programming 5 03-08-2010 02:02 AM
squirrelmail "error in login page"" when content advisor is enabled simi_virgo Linux - Networking 4 08-21-2008 01:25 PM
my web browser "mozilla fire fox" isn't rendering the page, rather opening the page amolgupta Linux - Software 2 07-26-2005 12:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration