Redirect people after SSL is set upWebsite redirect for httpsapache2 is directing to wrong pathPretty URL's not working with HTTPS apache serverApache 2.4 error 403 ForbiddenHow should I configure multiple virtual hosts with a single configuration file in Apache?Accessing my website hosted on apache changes the port number.Breaking links with apache2 after SSL installationCan't access my website with domain name with DigitalOceanapache2 ubuntu default page not redirecting to httpsVirtual Hosts Not Working (12.10)Apache wont restart after I enable SSLSetting up SSL on Apache2 - Not switching after apache2 restartUnable to restart apache2 after installing SSL certificateUnable to access remotely (LAMP issue)WebDav won't connect: 405 Method Not Allowedtrying to set up ssl cert but after a2ensite apache refuse to startApache Newbie Confused - Can't make directory listing workBreaking links with apache2 after SSL installationApache2 HTTP Ubuntu Won't Restart
Can socialism and capitalism coexist in the same country?
Could a technologically advanced society exist as a feudal monarchy?
Certainly naive, but I do not understand why this compiles
Is there any way my opponent can prevent me from winning in this situation?
Keep password in macro?
Do you need to reveal which specific tunnel you’re attempting to claim?
Emission vs reflection
If Alice tries to shift into Bob the same night that Bob is also killed by the militia, what happens?
Did Roger Rabbit exist prior to the film "Who Framed Roger Rabbit?"
How can I convince my department that I have the academic freedom to select textbooks and use multiple-choice tests in my courses?
How can I repair a leak in a PVC water line without bringing down the system for an extended period of time?
Is it possible for a moon to have a higher surface gravity than the planet it is attached to?
Looking for a restaurant in Vienna with a name similar to "An die 2 Linsen" that served huge Schnitzel
Using if/else structure in Google Earth Engine
Evil plans - how do you come up with interesting ones?
Most general definition of differentiation
How to protect assets from being passed to a beneficiary in a will when they are likely to die soon also
Which object has been to space the most times?
"Applicants for asylum must prove that they have fifteen family members in the Netherlands."
Calculate the movement required to get from one angle to another angle on a compass
What should be done if I suspect a player is using weighted dice?
A really basic question about ammeters and their ranges
Where to find the code for the terminal commands?
Team members' and manager's behaviour is indifferent after I announce my intention to leave in 8 months
Redirect people after SSL is set up
Website redirect for httpsapache2 is directing to wrong pathPretty URL's not working with HTTPS apache serverApache 2.4 error 403 ForbiddenHow should I configure multiple virtual hosts with a single configuration file in Apache?Accessing my website hosted on apache changes the port number.Breaking links with apache2 after SSL installationCan't access my website with domain name with DigitalOceanapache2 ubuntu default page not redirecting to httpsVirtual Hosts Not Working (12.10)Apache wont restart after I enable SSLSetting up SSL on Apache2 - Not switching after apache2 restartUnable to restart apache2 after installing SSL certificateUnable to access remotely (LAMP issue)WebDav won't connect: 405 Method Not Allowedtrying to set up ssl cert but after a2ensite apache refuse to startApache Newbie Confused - Can't make directory listing workBreaking links with apache2 after SSL installationApache2 HTTP Ubuntu Won't Restart
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
how do I set up the auto redirect with apache2. I have got SSL working and want to redirect all to the SSL side. I added Redirect / https://fraffel.tech/ but takes me to the wrong site directory whereas https takes me to the right spot. Is that the right thing to add for the redirect? (its in VirtualHost *:80)
Current VirtualHost file:
ServerName fraffel.tech
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/fraffeltech
Redirect / https://fraffel.tech/
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/fraffeltech
SSLEngine on
SSLCertificateFile /etc/ssl/fraffel_tech.crt
SSLCertificateKeyFile /etc/ssl/private/fraffel.tech.key
SSLCertificateChainFile /etc/ssl/fraffel_tech.ca-bundle
</VirtualHost>
server apache2 ssl
add a comment
|
how do I set up the auto redirect with apache2. I have got SSL working and want to redirect all to the SSL side. I added Redirect / https://fraffel.tech/ but takes me to the wrong site directory whereas https takes me to the right spot. Is that the right thing to add for the redirect? (its in VirtualHost *:80)
Current VirtualHost file:
ServerName fraffel.tech
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/fraffeltech
Redirect / https://fraffel.tech/
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/fraffeltech
SSLEngine on
SSLCertificateFile /etc/ssl/fraffel_tech.crt
SSLCertificateKeyFile /etc/ssl/private/fraffel.tech.key
SSLCertificateChainFile /etc/ssl/fraffel_tech.ca-bundle
</VirtualHost>
server apache2 ssl
add a comment
|
how do I set up the auto redirect with apache2. I have got SSL working and want to redirect all to the SSL side. I added Redirect / https://fraffel.tech/ but takes me to the wrong site directory whereas https takes me to the right spot. Is that the right thing to add for the redirect? (its in VirtualHost *:80)
Current VirtualHost file:
ServerName fraffel.tech
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/fraffeltech
Redirect / https://fraffel.tech/
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/fraffeltech
SSLEngine on
SSLCertificateFile /etc/ssl/fraffel_tech.crt
SSLCertificateKeyFile /etc/ssl/private/fraffel.tech.key
SSLCertificateChainFile /etc/ssl/fraffel_tech.ca-bundle
</VirtualHost>
server apache2 ssl
how do I set up the auto redirect with apache2. I have got SSL working and want to redirect all to the SSL side. I added Redirect / https://fraffel.tech/ but takes me to the wrong site directory whereas https takes me to the right spot. Is that the right thing to add for the redirect? (its in VirtualHost *:80)
Current VirtualHost file:
ServerName fraffel.tech
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/fraffeltech
Redirect / https://fraffel.tech/
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/fraffeltech
SSLEngine on
SSLCertificateFile /etc/ssl/fraffel_tech.crt
SSLCertificateKeyFile /etc/ssl/private/fraffel.tech.key
SSLCertificateChainFile /etc/ssl/fraffel_tech.ca-bundle
</VirtualHost>
server apache2 ssl
server apache2 ssl
edited May 3 '18 at 9:59
pa4080
19.7k8 gold badges44 silver badges90 bronze badges
19.7k8 gold badges44 silver badges90 bronze badges
asked May 3 '18 at 9:05
FRAFFEL MEDIAFRAFFEL MEDIA
471 silver badge3 bronze badges
471 silver badge3 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
The issue here is that the directive ServerName
is missing within the <VirtualHost>
tags. This is necessary to identify the virtual host.
Also, for this case, it is a good idea to use the directive Redirect
with the option permanent
- read the section "Redirect Methods" in this article.
ServerName example.com # This directive provides a global server name.
# But you should set ServerName also for each virtual host
# to identify it!!!
<VirtualHost *:80>
ServerName example.com
# Redirect Requests to HTTPS with HTTP 301 status
Redirect permanent "/" "https://example.com/"
# Other configuration directives...
</VirtualHost>
<VirtualHost _default_:443>
ServerName example.com
# Other configuration directives...
</VirtualHost>
Apply the configuration change and restart (or reload) Apache. Then flush your browser's cache or use an incognito window (or another browser) to see the change.
For this task you can use also rewrite rules as it is illustrated in this question, but within the Apaches documentation you will be advised to do not use the rewrite engine when you can use more simple directives.
Thanks heaps. Works in Firefox, just got to fix it in edge probably a cache issue.
– FRAFFEL MEDIA
May 3 '18 at 9:34
@FRAFFELMEDIA, yes, I can confirm I was redirected tohttps
when opened your site.
– pa4080
May 3 '18 at 9:35
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1031457%2fredirect-people-after-ssl-is-set-up%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The issue here is that the directive ServerName
is missing within the <VirtualHost>
tags. This is necessary to identify the virtual host.
Also, for this case, it is a good idea to use the directive Redirect
with the option permanent
- read the section "Redirect Methods" in this article.
ServerName example.com # This directive provides a global server name.
# But you should set ServerName also for each virtual host
# to identify it!!!
<VirtualHost *:80>
ServerName example.com
# Redirect Requests to HTTPS with HTTP 301 status
Redirect permanent "/" "https://example.com/"
# Other configuration directives...
</VirtualHost>
<VirtualHost _default_:443>
ServerName example.com
# Other configuration directives...
</VirtualHost>
Apply the configuration change and restart (or reload) Apache. Then flush your browser's cache or use an incognito window (or another browser) to see the change.
For this task you can use also rewrite rules as it is illustrated in this question, but within the Apaches documentation you will be advised to do not use the rewrite engine when you can use more simple directives.
Thanks heaps. Works in Firefox, just got to fix it in edge probably a cache issue.
– FRAFFEL MEDIA
May 3 '18 at 9:34
@FRAFFELMEDIA, yes, I can confirm I was redirected tohttps
when opened your site.
– pa4080
May 3 '18 at 9:35
add a comment
|
The issue here is that the directive ServerName
is missing within the <VirtualHost>
tags. This is necessary to identify the virtual host.
Also, for this case, it is a good idea to use the directive Redirect
with the option permanent
- read the section "Redirect Methods" in this article.
ServerName example.com # This directive provides a global server name.
# But you should set ServerName also for each virtual host
# to identify it!!!
<VirtualHost *:80>
ServerName example.com
# Redirect Requests to HTTPS with HTTP 301 status
Redirect permanent "/" "https://example.com/"
# Other configuration directives...
</VirtualHost>
<VirtualHost _default_:443>
ServerName example.com
# Other configuration directives...
</VirtualHost>
Apply the configuration change and restart (or reload) Apache. Then flush your browser's cache or use an incognito window (or another browser) to see the change.
For this task you can use also rewrite rules as it is illustrated in this question, but within the Apaches documentation you will be advised to do not use the rewrite engine when you can use more simple directives.
Thanks heaps. Works in Firefox, just got to fix it in edge probably a cache issue.
– FRAFFEL MEDIA
May 3 '18 at 9:34
@FRAFFELMEDIA, yes, I can confirm I was redirected tohttps
when opened your site.
– pa4080
May 3 '18 at 9:35
add a comment
|
The issue here is that the directive ServerName
is missing within the <VirtualHost>
tags. This is necessary to identify the virtual host.
Also, for this case, it is a good idea to use the directive Redirect
with the option permanent
- read the section "Redirect Methods" in this article.
ServerName example.com # This directive provides a global server name.
# But you should set ServerName also for each virtual host
# to identify it!!!
<VirtualHost *:80>
ServerName example.com
# Redirect Requests to HTTPS with HTTP 301 status
Redirect permanent "/" "https://example.com/"
# Other configuration directives...
</VirtualHost>
<VirtualHost _default_:443>
ServerName example.com
# Other configuration directives...
</VirtualHost>
Apply the configuration change and restart (or reload) Apache. Then flush your browser's cache or use an incognito window (or another browser) to see the change.
For this task you can use also rewrite rules as it is illustrated in this question, but within the Apaches documentation you will be advised to do not use the rewrite engine when you can use more simple directives.
The issue here is that the directive ServerName
is missing within the <VirtualHost>
tags. This is necessary to identify the virtual host.
Also, for this case, it is a good idea to use the directive Redirect
with the option permanent
- read the section "Redirect Methods" in this article.
ServerName example.com # This directive provides a global server name.
# But you should set ServerName also for each virtual host
# to identify it!!!
<VirtualHost *:80>
ServerName example.com
# Redirect Requests to HTTPS with HTTP 301 status
Redirect permanent "/" "https://example.com/"
# Other configuration directives...
</VirtualHost>
<VirtualHost _default_:443>
ServerName example.com
# Other configuration directives...
</VirtualHost>
Apply the configuration change and restart (or reload) Apache. Then flush your browser's cache or use an incognito window (or another browser) to see the change.
For this task you can use also rewrite rules as it is illustrated in this question, but within the Apaches documentation you will be advised to do not use the rewrite engine when you can use more simple directives.
edited Nov 29 at 11:14
answered May 3 '18 at 9:20
pa4080pa4080
19.7k8 gold badges44 silver badges90 bronze badges
19.7k8 gold badges44 silver badges90 bronze badges
Thanks heaps. Works in Firefox, just got to fix it in edge probably a cache issue.
– FRAFFEL MEDIA
May 3 '18 at 9:34
@FRAFFELMEDIA, yes, I can confirm I was redirected tohttps
when opened your site.
– pa4080
May 3 '18 at 9:35
add a comment
|
Thanks heaps. Works in Firefox, just got to fix it in edge probably a cache issue.
– FRAFFEL MEDIA
May 3 '18 at 9:34
@FRAFFELMEDIA, yes, I can confirm I was redirected tohttps
when opened your site.
– pa4080
May 3 '18 at 9:35
Thanks heaps. Works in Firefox, just got to fix it in edge probably a cache issue.
– FRAFFEL MEDIA
May 3 '18 at 9:34
Thanks heaps. Works in Firefox, just got to fix it in edge probably a cache issue.
– FRAFFEL MEDIA
May 3 '18 at 9:34
@FRAFFELMEDIA, yes, I can confirm I was redirected to
https
when opened your site.– pa4080
May 3 '18 at 9:35
@FRAFFELMEDIA, yes, I can confirm I was redirected to
https
when opened your site.– pa4080
May 3 '18 at 9:35
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1031457%2fredirect-people-after-ssl-is-set-up%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown