Is this valid and correct?
RewriteRule ^myOldPage.html$ /index.php#info [R]
I'm specifically interested about the #info
part.
If you're looking to change your podcast host from Anchor to another host, do not delete your Anchor account until you have redirected to your new host. You will need to initiate a 301 redirect to your new host first.
One can use the anchor tag to redirect to a particular section on the same page. You need to add ” id attribute” to the section you want to show and use the same id in href attribute with “#” in the anchor tag.
A 301 redirect is a permanent redirect from one URL to another. While they can redirect site page URLs, they can also redirect from one domain to another.
Yes. That's a valid 301 redirect (the HTTP standard allows for any valid URI to be provided as the redirect).
Now the caveat: Not all search engines may love the redirect. Google does a fantastic job of handling anchor tags (they even have a patent on this), while others will completely ignore them. As long as that's not an issue, the redirect is technically valid.
Update: If you're having trouble with mod_rewrite, try the NE (no escape) flag to prevent the # symbol from getting encoded:
RewriteRule ^myOldPage.html$ /index.php#info [R,NE]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With