how to enable mod_rewrite for SSL enabled site in ubuntu 16
The mod rewrite is not working for my WordPress site
The hosting is Google with Ubuntu 16
I have added "Allowoverride to All in
cd /etc/apache2/sites-available$ cat 000-default.conf
The contents of the file are:
Umar@sla-boot:/etc/apache2/sites-available$ cat 000-default.conf
<VirtualHost *:80>
ServerName liveonlinetrainingcourses.com
ServerAlias www.liveonlinetrainingcourses.com
DocumentRoot /var/www/otc/
<Directory /var/www/otc>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
#Require all granted
Order allow,deny
allow from all
</Directory>
Redirect permanent / https://liveonlinetrainingcourses.com/
</VirtualHost>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName liveonlinetrainingcourses.com
ServerAlias www.liveonlinetrainingcourses.com
ServerAdmin hello@liveonlinetrainingcourses.com
DocumentRoot /var/www/otc/
SSLEngine on
SSLCertificateFile /home/Umar/liveonlinetrainingcourses.com.crt
SSLCertificateKeyFile /home/Umar/liveonlinetrainingcourses.com.key
SSLCACertificateFile /home/Umar/intermediate.crt
#SSLCertificateChainFile /home/Umar/intermediate.crt
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
The .htaccess file is
Umar@sla-boot:/etc/apache2/sites-available$ cd /var/www/otc/
Umar@sla-boot:/var/www/otc$ cat .htaccess
# BEGIN GoDaddy-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^liveonlinetrainingcourses.com$ [OR]
RewriteCond %{SERVER_NAME} ^www.liveonlinetrainingcourses.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GoDaddy-SSL
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
server apache2 ssl mod-rewrite
add a comment |
The mod rewrite is not working for my WordPress site
The hosting is Google with Ubuntu 16
I have added "Allowoverride to All in
cd /etc/apache2/sites-available$ cat 000-default.conf
The contents of the file are:
Umar@sla-boot:/etc/apache2/sites-available$ cat 000-default.conf
<VirtualHost *:80>
ServerName liveonlinetrainingcourses.com
ServerAlias www.liveonlinetrainingcourses.com
DocumentRoot /var/www/otc/
<Directory /var/www/otc>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
#Require all granted
Order allow,deny
allow from all
</Directory>
Redirect permanent / https://liveonlinetrainingcourses.com/
</VirtualHost>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName liveonlinetrainingcourses.com
ServerAlias www.liveonlinetrainingcourses.com
ServerAdmin hello@liveonlinetrainingcourses.com
DocumentRoot /var/www/otc/
SSLEngine on
SSLCertificateFile /home/Umar/liveonlinetrainingcourses.com.crt
SSLCertificateKeyFile /home/Umar/liveonlinetrainingcourses.com.key
SSLCACertificateFile /home/Umar/intermediate.crt
#SSLCertificateChainFile /home/Umar/intermediate.crt
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
The .htaccess file is
Umar@sla-boot:/etc/apache2/sites-available$ cd /var/www/otc/
Umar@sla-boot:/var/www/otc$ cat .htaccess
# BEGIN GoDaddy-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^liveonlinetrainingcourses.com$ [OR]
RewriteCond %{SERVER_NAME} ^www.liveonlinetrainingcourses.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GoDaddy-SSL
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
server apache2 ssl mod-rewrite
You need to enable mod_rewrite by creating a link inmods-enabledtorewrite.loadinmods-availableand restarting the server. Did you do this?
– Jos
Jan 8 at 11:30
mod rewrite is already enabled
– Umar
Jan 8 at 12:46
add a comment |
The mod rewrite is not working for my WordPress site
The hosting is Google with Ubuntu 16
I have added "Allowoverride to All in
cd /etc/apache2/sites-available$ cat 000-default.conf
The contents of the file are:
Umar@sla-boot:/etc/apache2/sites-available$ cat 000-default.conf
<VirtualHost *:80>
ServerName liveonlinetrainingcourses.com
ServerAlias www.liveonlinetrainingcourses.com
DocumentRoot /var/www/otc/
<Directory /var/www/otc>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
#Require all granted
Order allow,deny
allow from all
</Directory>
Redirect permanent / https://liveonlinetrainingcourses.com/
</VirtualHost>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName liveonlinetrainingcourses.com
ServerAlias www.liveonlinetrainingcourses.com
ServerAdmin hello@liveonlinetrainingcourses.com
DocumentRoot /var/www/otc/
SSLEngine on
SSLCertificateFile /home/Umar/liveonlinetrainingcourses.com.crt
SSLCertificateKeyFile /home/Umar/liveonlinetrainingcourses.com.key
SSLCACertificateFile /home/Umar/intermediate.crt
#SSLCertificateChainFile /home/Umar/intermediate.crt
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
The .htaccess file is
Umar@sla-boot:/etc/apache2/sites-available$ cd /var/www/otc/
Umar@sla-boot:/var/www/otc$ cat .htaccess
# BEGIN GoDaddy-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^liveonlinetrainingcourses.com$ [OR]
RewriteCond %{SERVER_NAME} ^www.liveonlinetrainingcourses.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GoDaddy-SSL
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
server apache2 ssl mod-rewrite
The mod rewrite is not working for my WordPress site
The hosting is Google with Ubuntu 16
I have added "Allowoverride to All in
cd /etc/apache2/sites-available$ cat 000-default.conf
The contents of the file are:
Umar@sla-boot:/etc/apache2/sites-available$ cat 000-default.conf
<VirtualHost *:80>
ServerName liveonlinetrainingcourses.com
ServerAlias www.liveonlinetrainingcourses.com
DocumentRoot /var/www/otc/
<Directory /var/www/otc>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
#Require all granted
Order allow,deny
allow from all
</Directory>
Redirect permanent / https://liveonlinetrainingcourses.com/
</VirtualHost>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName liveonlinetrainingcourses.com
ServerAlias www.liveonlinetrainingcourses.com
ServerAdmin hello@liveonlinetrainingcourses.com
DocumentRoot /var/www/otc/
SSLEngine on
SSLCertificateFile /home/Umar/liveonlinetrainingcourses.com.crt
SSLCertificateKeyFile /home/Umar/liveonlinetrainingcourses.com.key
SSLCACertificateFile /home/Umar/intermediate.crt
#SSLCertificateChainFile /home/Umar/intermediate.crt
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
The .htaccess file is
Umar@sla-boot:/etc/apache2/sites-available$ cd /var/www/otc/
Umar@sla-boot:/var/www/otc$ cat .htaccess
# BEGIN GoDaddy-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^liveonlinetrainingcourses.com$ [OR]
RewriteCond %{SERVER_NAME} ^www.liveonlinetrainingcourses.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GoDaddy-SSL
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
server apache2 ssl mod-rewrite
server apache2 ssl mod-rewrite
asked Jan 8 at 11:26
UmarUmar
10816
10816
You need to enable mod_rewrite by creating a link inmods-enabledtorewrite.loadinmods-availableand restarting the server. Did you do this?
– Jos
Jan 8 at 11:30
mod rewrite is already enabled
– Umar
Jan 8 at 12:46
add a comment |
You need to enable mod_rewrite by creating a link inmods-enabledtorewrite.loadinmods-availableand restarting the server. Did you do this?
– Jos
Jan 8 at 11:30
mod rewrite is already enabled
– Umar
Jan 8 at 12:46
You need to enable mod_rewrite by creating a link in
mods-enabled to rewrite.load in mods-available and restarting the server. Did you do this?– Jos
Jan 8 at 11:30
You need to enable mod_rewrite by creating a link in
mods-enabled to rewrite.load in mods-available and restarting the server. Did you do this?– Jos
Jan 8 at 11:30
mod rewrite is already enabled
– Umar
Jan 8 at 12:46
mod rewrite is already enabled
– Umar
Jan 8 at 12:46
add a comment |
0
active
oldest
votes
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/3.0/"u003ecc by-sa 3.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%2f1107954%2fhow-to-enable-mod-rewrite-for-ssl-enabled-site-in-ubuntu-16%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f1107954%2fhow-to-enable-mod-rewrite-for-ssl-enabled-site-in-ubuntu-16%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
You need to enable mod_rewrite by creating a link in
mods-enabledtorewrite.loadinmods-availableand restarting the server. Did you do this?– Jos
Jan 8 at 11:30
mod rewrite is already enabled
– Umar
Jan 8 at 12:46