0

Here's the code:

RewriteOptions inherit

RewriteCond %{HTTP_HOST} ^old\.olddomain\.example$ [NC]
RewriteRule ^ https://newdomain.example%{REQUEST_URI} [R=301,L]



# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
  • Tested it and it works fine on Windows 10 (laptop) and Iphone, but not Windows 8. Weird.

  • Browsers: Google Chrome version 84.0.4147.125 (Official Build) (64-bit), Firefox Version version 79.0 (64-bit).

  • Server Version: Apache/2.4.46 (cPanel) OpenSSL/1.1.1g mod_bwlimited/1.4, Server MPM: prefork, Server Built: Aug 11 2020 21:16:32

  • Host says mod_rewrite is on

  • It doesn't redirect at all, it stays on the original domain if you click throughout the site.

  • Already flushed DNS and cleared browser caches

  • Now I'm noticing it isn't updating my latest Wordpress post. This is the weirdest thing because it's only happening on one of my devices but all of its browsers (desktop with Windows 8.1).

  • Only recent changes on site: upgraded to PHP 7.4 for old domain and new domain. New host migrated site from old host. Have since cancelled with new host. They said they didn't make any changes to 301 Redirects.

  • Latest update: now it's timing out on Windows 8.1, but it's working fine on everything else...

6
  • 2
    May be the browsers have old caches intact. For testing sake, can you clear browser caches and try again. (Better you could try in incognito mode.) – Kannan Aug 17 '20 at 6:20
  • Are these all the directives you have in your .htaccess file? "RewriteOptions inherit" - what directives are you inheriting? – MrWhite Aug 17 '20 at 7:55
  • 1
    What version of Apache do you have installed on each machine? What modules are installed? (Is mod_rowrite installed and enabled?) – Stephen Ostermiller Aug 17 '20 at 8:15
  • So you have only one server, but you are saying that clients on Windows 8 don't redirect? I thought you were running a server on Windows 10 and another server on Windows 8. – Stephen Ostermiller Aug 17 '20 at 19:05
  • I don't own any servers, I have my site on a dedicated cloud server from my host. But if I test the site, it doesn't work on my Windows 8 desktop but it does work on my Windows 10 laptop and iphone. – A D Aug 18 '20 at 5:47
1

Found the problem lol:

C:\Windows\System32\drivers\etc\hosts

I suspected it was something local. When I was trying out a new host a couple days ago, I made edits to the local host file to test if the site was online and forgot to revert it back to the original.

1
  • Happens. Many would have encountered such simple mistakes at some point in time :) – Kannan Aug 18 '20 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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