Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

With my current .htaccess, this is what happens:

https://www.dukescasino.com/ - works perfectly

https://dukescasino.com/ - redirects to the above which is great

The two options below loads fine, but it should be redirecting to the https version:

http://www.dukescasino.com/

http://dukescasino.com/

Here is the current .htaccess:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

# BEGIN WordPress

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

I don't believe it is relevant, but if so, here is the list of current active plugins:

  • Advanced Custom Fields

  • All In One SEO Pack

  • Bop Search Box Item Type For Nav Menus

  • Contact Form 7

  • Disable Comments

  • Google XML Sitemaps

  • Jetpack by WordPress.com

  • Search & Filter

  • Slider WD

  • TablePress

  • UpdraftPlus - Backup/Restore

  • Wordfence Security

  • WPide

  • WP Smush

  • WP Super Cache

Result: 302 found. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request

1 Answer

0 votes
by (106k points)

To get rid of the error you can use the below mentioned code:-

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteCond %{ENV:HTTPS} !=on

RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...