We have switched domain names from example.com to example.org . I have set up a general 301 redirect for all of the site URLs in the .htaccess file on the example.com server and all the pages are redirecting fine.
However, the link to the style sheet on hundreds of old pages is not redirecting so the pages are showing up with no CSS formatting.
Here is the the code in the header of each page linking to the style sheet.
<link rel="stylesheet" href="http://www.example.com/amazon/styles-site.css" type="text/css" />
If you paste http://www.example.com/amazon/styles-site.css
into a browser it redirects to the proper URL https://example.org/amazon/styles-site.css
.
What do I need to do to get the old styles-site.css URL to redirect to the new url?
Thanks for any information you can provide.
The .htaccess file on the example.com server has the following redirect, which seems to be working for everything except for the .css file mentioned above.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule (.*)$ https://example.org/$1 [R=301,L]
</IfModule>
.com
your old domain? Have you tried just switching thehref
of the stylesheet to a.org
URL?example.com
toexample.org
at some point? (Going forward, you shouldn't be relying on the redirect.) "The .htaccess file on the example.com server" - so it's an entirely different server?