Redirecting domain to https - port no. defined in url

Discussion in 'Server Operation' started by bjarne-j, Dec 29, 2015.

  1. bjarne-j

    bjarne-j New Member

    Hi all
    I'm using following code to redirect all trafic to ssl:
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
    It works well except for some times when my application returns from eg. a log off action to "" or "". Not running ssl and breaks links to css, pictures etc.
    I would really prefer to solve this by a rewrite rule or similar instead of changing application code (which I haven't developed). I've searched for a solution and tried to figure it out by looking on rewritecond and rewriterules - but haven't found a working solution - any ideas?

    Thanks in advance
    nikolaosp likes this.
  2. bjarne-j

    bjarne-j New Member

    I didn't found any apache solution to this. Problem solved by change of the application code.

Share This Page