Welcome to WebmasterWorld Guest from 54.159.94.253

Forum Moderators: rogerd & travelin cat

Unusual url string being created - how to fix?

     
12:22 am on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


Can anyone help with this?
Difficult to describe without a url but here goes...

Paginated archives of categories have been duplicated with the full url (although only one '/' in the https:/w)
being added to the main domain url up to the category.

I have deactivated all plugins, changed theme to Wordpress 2017, and checked htaccess - but to no avail...

ie - duplicate of actual page https//:wwwdotdomaindotcom/category/page2
THIS>>>
https//:wwwdotdomaindotcom/category/https/:wwwdotdomaindotcom/category/page2

(and these have been indexed by Google - and there are several hunded of them)
Any suggestions?

[edited by: Gemini23 at 12:25 am (utc) on Feb 13, 2018]

2:16 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


This is the custom structure permalink
/news/%post_id%/%postname%/
2:21 pm on Feb 13, 2018 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 16, 2003
posts:1951
votes: 9


Try a quick test with no base and no custom structure - at least it might rule it out.
2:40 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


okay - update
If I remove the 'Category base' entirely - this then leaves the word 'category' in the url (whcih I wanted to remove)
the the page comes up as a page not found - their is no redirect and styling of the age is gone, but this is likely to do with taking everything out of htaccess (to the bare bones) and removing ALL plugins...

so.. Category base issue - BUT - surely a Category base should be okay? (a pain to remove it (and possibly a bigger pain to leave it) a lot of urls will be broken...
2:41 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


please excuse typos...
2:47 pm on Feb 13, 2018 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 16, 2003
posts:1951
votes: 9


FYI I fixed the issue with mine;

Permanlink was: /review/blahblah
Custom base was: /reviews/

I suspect an inefficient regex match was causing the issue somewhere. Changing the base from /reviews/ to /info/ resolved the problem. Had to update a few redirects, but only a 30 page site at the moment, so not a big deal!

Possibly a similar issue to what you're facing, although I don't see how the permalink settings could cause the http with a single slash you mentioned in your OP.

Did you try removing the custom permalink as well?
3:00 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


I have been online with this site for a number of years - 7000+ posts - with that custom post type - now THAT would/could cause a massive problem...

Re the category base - it seems that I cannot change it to anything - just tried 'elephant' and the page still resolves (which I guess makes it the 'elephant in the room')

I have read elsewhere (cannot recall where) that permalinks don't affect pages - and this is archive pages of categories...
3:06 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


Actually - it doesn't resolve it...

when removing the Custom Base and leaving it blank - then the only way to get the url to resolve is to add the custom post 'base'
into the url - which then leaves /news/category/etc/page200/etc and the false url the resolves again...
3:07 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


IF anyone would like me to message them the actual url just let me know - otherwise, answers on a postcard...
3:11 pm on Feb 13, 2018 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 16, 2003
posts:1951
votes: 9


Ha yeh, best to avoid a mass URL change if possible! ;)

By "pages" I think that was possibly referring to individually created pages which exclusively use the post slug as the URL (/page-name/) and don't use the permalink or category base format (some themes may do, but generally they don't). Paginated pages are different - blog home, categories, tag pages, author posts, etc as they're dynamic collections of posts.

Do you have a deep category structure? I.e. multiple tiers of sub categories: /cat1/sub1/sub2/post-name/
3:17 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


Just one category deep
ie base url elephant/todaysnewscategory1/page2/

Not noticed this before... but as above
IF Category Base is present then the Custom post /news/ first part of Custom post structure) is NOT used in the url
IF Category Base is empty/blank the Custom post /news/ first part of Custom post structure) IS used in the url
3:40 pm on Feb 13, 2018 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 16, 2003
posts:1951
votes: 9


It's possible the /news/ part of the permalink is conflicting with a category or page with a similar name.

Trying installing 'debug this' plugin, navigate to the error page and select Query > Rewrites. Bottom of the page will display the rewrite URLs matched by the page. Under "current rewrite" it'll show the matched query. If it says "category_name=my-category", then this is the issue (WP is confusing the page as a category and implementing the wrong rewrite rule).
3:53 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


Thanks - I can give that a try - but how do I do this? "navigate to the error page and select Query"

This is a category archive page that doesn't exist as a page etc...
3:57 pm on Feb 13, 2018 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 16, 2003
posts:1951
votes: 9


Go to the category page and click page 2. That's the page that's returning the error / duplication yes?
3:59 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


found it...
4:02 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


in fact..

shows/(.+?)/page/?([0-9]{1,})/?$index.php?category_name=$matches[1]&paged=$matches[2]

which is highlighted but I don't know what this means or how to fix it?

PS - this is within the body of the page - nothing at the bottom...

PPS When I hit Query I notice the url changes to the orginal url and not the re-created one...
4:17 pm on Feb 13, 2018 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 16, 2003
posts:1951
votes: 9


Do you have a category called 'news' or something close?

If so, that's the issue - WP is mistaking your /page/2/ for a category and using the wrong rewrite rule (as category rewrites run first - the debug list will show you the order).

Option A) Find the offending category and change its name so it doesn't conflict with anything else.
Option B) Update functions.php to correctly identify rewrites.

Can't help with that bit unfortunately but maybe someone else can.
4:45 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


I have amended category names - not sure there was a conflict there - but it hasn't made any difference...
10:09 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


Okay... this is now weird...
on another domain - same hosting (siteground) ... with an add-on domain with the same problem...

Custom post is /%postname%/
No Category base

Do all add-on domains inherit the main domain htaccess?
ANy other suggestions?
10:19 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


Hm... If I go to a well-known seo plugin website beginning with Y and ending in T and look at their archived pages... I get (sort of) the same result...
ie - if I copy the full url including page number and paste it after the category - the url will resolve... the only difference is that the canonical is the correct url and not the 'false' one...

so... maybe this is a 'problem' that exists - but how to correct the incorrect canonical and remove the hundreds of indexed urls...
10:31 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Sept 14, 2011
posts:1044
votes: 129


I just tried it with one of my wordpress installs, I don't get a 404 but canonical is there

When you have a dynamic site there are always multiple canonical urls thats why the canonical tag exists. I thought your problem was you were internally linking to these pages, of course that would be a major problem. If simply these pages exist in Google, not so big a deal. Use canonical tag to point Google to correct page and forget about it.
10:37 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


These are archive pages across different categories (several hundred of them - although I can only see one category indexed) - so I don't know how to "Use canonical tag to point Google to correct page and forget about it."
10:40 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Sept 14, 2011
posts:1044
votes: 129


Can I just be clear are you able to navigate to the pages within the site or is this an indexing issue?
10:48 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


The pages are NOT navigatable - I only discovered them by seeing them indexed in Google - about 700 pages... which are duplicates of archived pages that can be navigated to... I don't know how or why the urls were generated and then indexed... the Google cache is (from those I have looked at ) from end of Nov to end of Dec 2017.

I guess I could make the archive pages all no-indexed - not sure of the benefit or not of that in a 'normal' sense...
10:53 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Sept 14, 2011
posts:1044
votes: 129


Reinstall Yoast Seo this will add the correct canonical tag to all the pages and forget about it.
11:00 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


I haven't used Yoast in some time - but thinking about it - how is it possible to add a canonical to a page that doesn't (or shouldn't) exist in the normal generation of archived pagination...
ie the current archived pages have the correct canonical
exampledotcom/base/category/page/2/ (canonical to same)

but the following has been generated - sometime during Nov-Dec I think
exampledotcom/base/category/exampledotcom/base/category/page/2/
which has a self-referencing canonical... and most likely it won't matter what is done to the original it won't affect the 'copy'
11:06 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Sept 14, 2011
posts:1044
votes: 129


On paginated pages like category or tag archives, date archives or author archives, Yoast SEO will add a canonical to the current paginated page. So, say you’re on example.com/category/uncategorized/page/2/, the canonical will point at exactly that URL. Yoast SEO will also addrel="next" and rel="prev" links, pointing to the previous and the next page in the paginated series. These three combined make sure that search engines understand that they’re on a paginated series and will crawl it accordingly.


[kb.yoast.com...]
11:09 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Sept 14, 2011
posts:1044
votes: 129


how is it possible to add a canonical to a page that doesn't (or shouldn't) exist in the normal generation of archived pagination


The page you refer to is a canonical page itself so the canonical tag will add the correct pagination page
11:22 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


I understand this... and this is currently the case...
So, say you’re on example.com/category/uncategorized/page/2/, the canonical will point at exactly that URL. Yoast SEO will also addrel="next" and rel="prev"
THAT is what is on current correct pages...
but for the 'false' page/url - that has its own canonical... no idea how these false urls were even generated...
11:25 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month

joined:Sept 14, 2011
posts:1044
votes: 129


Yoast will generate the correct canonical for the false pages, you will need to remove any custom code
11:33 pm on Feb 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 658
votes: 3


I will give it a try although not sure how it will work - but happy to give it a try :)
This 62 message thread spans 3 pages: 62
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members