Displays url's twice and getting 404 errors after activating

I have activated SSL to my site

On my wordpress multisite, I am getting 404 errors when I am entering a correct url for example http://site.org/wp-admin it automatically redirecting and giving https://site.org/wp-adminwp-admin

Is there any code that i need to add or remove in the .htaccess code to get this fixed?

Topic site-url redirect Wordpress

Category Web


Here is the .htaccess code

# Use PHP 5.4
AddType application/x-httpd-php54 .php 

# BEGIN s2Member GZIP exclusions

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+ [OR]
RewriteCond %{QUERY_STRING} (^|\?|&)no-gzip\=1
RewriteRule .* - [E=no-gzip:1]
</IfModule>

# END s2Member GZIP exclusions

# BEGIN SSL
RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ [https://]%{HTTP_HOST}%{REQUEST_URI}$1 [R=301,L]
# END SSL

# BEGIN WordPress
RewriteEngine on
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^siteslogin$ https://example.com/wp-login.php [NC,L]
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]

<FilesMatch "\.pdf$">
header set x-robots-tag: noindex
</FilesMatch>
# END WordPress

**And here is the wpconfig code**
# Use PHP 5.4
AddType application/x-httpd-php54 .php 

# BEGIN s2Member GZIP exclusions
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+ [OR]
RewriteCond %{QUERY_STRING} (^|\?|&)no-gzip\=1
RewriteRule .* - [E=no-gzip:1]
</IfModule>
# END s2Member GZIP exclusions

# BEGIN SSL
RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ [https:]//%{HTTP_HOST}%{REQUEST_URI}$1 [R=301,L]
# END SSL

# BEGIN WordPress
RewriteEngine on
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^siteslogin$ https://example.com/wp-login.php [NC,L]
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]

<FilesMatch "\.pdf$">
header set x-robots-tag: noindex
</FilesMatch>
# END WordPress

Sounds like your Apache httpd.conf is missing a virtual host entry for port 443.

Listen 443

<VirtualHost *:443>
  ServerName www.foo.com
  DocumentRoot /var/www/www.foo.com/htdocs

  CustomLog /var/log/apache/www.foo.com-access.log combined
  ErrorLog /var/log/apache/www.foo.com-error.log

  # Example SSL configuration
  SSLEngine on
  SSLProtocol all -SSLv2
  SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
  SSLCertificateFile "/var/www/www.foo.com/ssl/server.crt"
  SSLCertificateKeyFile "/var/www/www.foo.com/ssl/server.key"
</VirtualHost>

Source: http://wiki.apache.org/httpd/ExampleVhosts

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.