Create and enable SSL in the XAMPP server:
Go to C:\Windows\System32\drivers\etc --> open hosts file with notepad++ --> add 127.0.0.1 domainName.com at the last same as picture below
Download the file from the following link...
Secure the connection:
Open the cert.conf file and change {{DOMAIN}} under the CommonName default as domainName.com like mozahedul.com -->
Do the same thing in DNS.1 with mozahedul.com --> save and close
Now click on make-cert.bat --> insert the domain name that has already been created --> and follow the step as the screen shows -->
A folder will create named domainName.com like mozahedul.com --> open the folder and double click on the server.crt -> click "Install Certificate" button --> select "Local machine" --> Next --> select "Select all certificates in the following store" --> click on "Browse" button --> Select "Trusted Root Certification Authorities" --> Next --> Finish
Now go to C:\xampp\apache\conf\extra --> Open the file httpd-xampp.conf --> Now go to downloaded folder and open the file named server.txt --> copy the code from that file --> and paste it at the bottom of httpd-xampp.conf file --> Now change the DocumentRoot with the htdocs directory path, serverName with the domain name, serverAlias with domain name
In SSLCertificateFile, change the "site.test" with domainName.com like mozahedul.com --> save the file and close it
Now start or restart XAMPP server --> go to the browser and open the project with localhost --> A problem still exists --> when we open the project, it will redirect to localhost
Solution:
Go to WordPress admin panel --> settings --> change the localhost URL with URL same as below ...
Now go to the browser and the URL will not change to localhost anymore.
JetPack plugin might create a problem, then you have to add const JETPACK_DEV_DEBUG = TRUE; in the wp_config.php file, just before /* That's all, stop editing! Happy publishing. */
Post a Comment