[opensuse] Apache Redirection
Redirect permanent / https://www.mysite.com/ or RewriteEngine on RewriteCond %{SERVER_NAME} =www.mysite.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] So these are two different ways of performing a redirect. I have always used the former in my config. I notice that the latter method using the Rewrite engine is automatically generated by certbot. So which is better? What are the pros an cons of each method? Why does certbot choose to use the Rewrite engine? Can anyone please enlighten me? Thank you Paul -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Paul Groves wrote:
Redirect permanent / https://www.mysite.com/
or
RewriteEngine on RewriteCond %{SERVER_NAME} =www.mysite.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
So these are two different ways of performing a redirect.
There is on minor differences, but it probably don't matter much. The latter will _only_ redirect when hostname matches "www.site.com" whereas the former will redirect everything. They will both produce a 301 redirect.
So which is better? What are the pros an cons of each method? Why does certbot choose to use the Rewrite engine?
It's either habit or because hostname is important. -- Per Jessen, Zürich (9.8°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, 18 Oct 2018 07:37:55 +0200 Per Jessen <per@computer.org> wrote:
Paul Groves wrote:
Redirect permanent / https://www.mysite.com/
or
RewriteEngine on RewriteCond %{SERVER_NAME} =www.mysite.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
So these are two different ways of performing a redirect.
There is on minor differences, but it probably don't matter much. The latter will _only_ redirect when hostname matches "www.site.com" whereas the former will redirect everything.
They will both produce a 301 redirect.
So which is better? What are the pros an cons of each method? Why does certbot choose to use the Rewrite engine?
It's either habit or because hostname is important.
Plus the second method requires enabling the rewrite engine and so exposes you to some more methods of attack. So you need to be a little bit more on guard. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Dave Howorth
-
Paul Groves
-
Per Jessen