-1

I have Wordpress site and I have move form http:// to https:// and when i open first time than :443 automatic add with url and i am getting error message that 400 Bad Request The plain HTTP request was sent to HTTPS port.
Example ,
Orginal URL : https://example.com/dev/
When open first time : http://xyz.example:443/dev/

Redirect rule of .httaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dev/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /dev/index.php [L]
</IfModule>

Would you like to tell me how can i resolve this issue ?

closed as off-topic by Mark Kaplun, Nathan Johnson, Krzysiek Dróżdż, Jacob Peattie, Fayaz Apr 5 '18 at 4:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?" – Mark Kaplun, Nathan Johnson, Krzysiek Dróżdż, Jacob Peattie, Fayaz
If this question can be reworded to fit the rules in the help center, please edit the question.

  • How did you configure the redirect? In .htaccess? In your virtual host config? Can you add the redirect rules to the question body? – DaveLak Mar 29 '18 at 3:39
  • Ok , I have added redirect configure in body.. – Vishal Chodvadiya Mar 29 '18 at 3:48
  • Is there anything with any of the following in it: SSLEngine On, RewriteEngine On, RewriteCond %{HTTPS} off? There should be a directive somewhere that tells the server to upgrade http requests to https. How did you enable SSL/TLS? Did you modify one of the files on the server or use a plugin? Btw, you can format multiple lines of code by putting four(4) space characters before it, it makes it easier to read. – DaveLak Mar 29 '18 at 4:11
  • I have changed all http:// to https:// an I did not use any plugin. – Vishal Chodvadiya Mar 29 '18 at 4:27
  • "something do not work for me" is a bad type of question unless all relevant information is added. As the htaccess is just a small part of where such a behaviour can start it is just not helpful enough, unless you know the problem is with it. At this stage, answers are going to be no more than guesses – Mark Kaplun Mar 29 '18 at 9:33
2

The problem may be in the SSL implementation itself. You just have to follow a number of steps as outlined below (apologies if you have done all of this already):

Once the server is configured to use an SSL certificate, you need to check that SSL / TLS support is selected for the hosting (I use Plesk and this appears as a checkbox on the server).

Next I add the following lines to the top of the .htaccess file (before the standard Wordpress directives):

#SSL redirect
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://yoursite.name/$1 [R=301,L]
# END Redirect SSL

Once this is done, log in to your site and set the WordPress and Site addresses in Settings > General Settings to include the 'https' addresses.

At this point Wordpress will log you out of the system, so you will need to log in again.

SSL should be working at this point but you may not see the green lock yet in the URL bar. This is because any references to 'http' on the page will need to be changed.

There are sites to help with this like https://www.whynopadlock.com/.

I usually just do a search and replace for all http references and replace these with https. You can use the free program https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ while this program works very well, be a little careful when using it by always doing a dry run and checking the suggestions before committing the changes.

[Aside] Once Wordpress is working with SSL, don't forget to update Search Console and Webmaster tools. I also suggest that you resubmit sitemaps to Google and Bing.

Not the answer you're looking for? Browse other questions tagged or ask your own question.