Forum Moderators: phranque

Message Too Old, No Replies

need help on htaccess redirection

         

yanko

5:35 am on Sep 12, 2021 (gmt 0)

10+ Year Member



Hi

recently i just installed a plugin and apparently it add additional characters which i don't need

https://www.example.com/post.html/amp/
https://www.example.com/post.html/amp


these new url creating issues on my webmaster console (404 error and other errors)

im not sure what to do, but im thinking to redirect them to the original post url

with url pattern above, can someone suggest me htacces code to catch all these URLs properly

thank you

not2easy

2:08 pm on Sep 12, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It could help if you define what additional characters you don't need. If your plugin is adding on ".html/amp/" and does not offer a way to comply with your Permalink settings you might want to look for a better plugin. Rather than redirecting, you can use canonical tags and ensure that your sitemaps only generate one version for each page or post.

It is generally a bad idea to use plugins that add additional characters and then try to control the result with rewrite rules. WP will continue to create and store URLs in the format you selected in your settings and can cause further problems in archive URLs that change based on dates. WP typically generates at least 4 different versions of each post or page and only one should be submitted for indexing.

not2easy

3:37 pm on Sep 12, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I should add for clarity that the main concern against creating URLs and then rewriting them is that if those URLs that are being created by the plugin show up on a sitemap (if they are intended to be indexed) there is no way to submit that sitemap and then show a different URL to be indexed and please the bots. If these URLs are not intended to be indexed (if their content can be found on a different indexed URL) then the canonical meta tag should take care of the problem.