1

I have wordoress site where I am getting /1 in the URL. I have checked siteurl,homeurl,permalinks but not sure why /1 is getting added in the URL

e.g https://example.com/consulting/strategic-marketing/1/wp-content/themes/cubemanagement/favicon.ico

The correct URL should be https://example.com/wp-content/themes/cubemanagement/favicon.ico

How can I setup redirection? I have tried below methods without success

  1. RewriteRule ^(.+?)-\d+/?$ /$1 [L,R=302]
  2. RewriteRule ^$/$/1/$ https://www. example.com/ [L,R=301]
  3. RewriteRule ^(.*)/(.*)/1/$ https://www.example.com/ [L,R=301]
  • In your example there is more than just an additional `/1` in the URL? Does this apply to _all_ URLs? Where are you putting these rules in your `.htaccess` file? However, implementing a redirect as you suggest is not really an acceptable solution (even if this does "work") - it will be detrimental to SEO, your site users (slow) and your server (extra load). – MrWhite Sep 12 '22 at 23:47
  • Most probably the redirection happens in WordPress. If so you need to fix it there. – Gerald Schneider Sep 13 '22 at 05:18
  • MR white, yes this happens with all URL If I removed all rules from .htaccess redirection still happens. – user8863627 Sep 13 '22 at 16:45
  • I have not set any rule or any redirection. Everything is correct but still I am not sure how /1 is getting added in he URL automatically. If you see cubemanagement.com/sitemap_index.xml, there as well you will get ;/1 added in the URL. – user8863627 Sep 13 '22 at 18:57
  • So, WordPress (or some plugin) is generating URLs with this additional `/1` (or `/consulting/strategic-marketing/1`?), including in your sitemap. You cannot "fix" this with a redirect, except to "correct" SEO if these incorrect URLs have been indexed or linked to by third parties, once the underlying URLs have been corrected. But do these "incorrect" URLs return a valid response or do they return a 404? As suggested above, you need to fix this in WordPress. (I have vague recollection that I have seen a similar question before, although I can't seem to find it??) – MrWhite Sep 13 '22 at 19:20
  • I’m voting to close this question because it is WordPress related and would perhaps be better resolved on https://wordpress.stackexchange.com/ – MrWhite Sep 13 '22 at 19:28

0 Answers0