Welcome to WebmasterWorld Guest from 54.196.190.32

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

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: 684
votes: 4


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]

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

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


can you post an example url substituting your domain and category with "example.com" and "category"
12:25 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: 684
votes: 4


Hi seo skunk - I have edited so hopefully that will make sense - I posted with the actual url as I thought it would help, but the post was deleted - I assume due to having a link...
12:31 am on Feb 13, 2018 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


Oh I see you have a slash in your url path, look for some custom coding in functions.php, basically when paginating wordpress is picking up a forward slash / before the link and this is causing the problem
12:34 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: 684
votes: 4


Thanks - If I switch to wordpress 2017 theme will this not change the functions.php?
12:36 am on Feb 13, 2018 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


yes you could try switching theme, if the problem still there you will need to look at .htaccess
12:38 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: 684
votes: 4


I think I have copied correctly - but to confirm... an example...

where this is the correct and live url
https://www.example.com/categorybase/category/page/250/

and is being duplicated... as follows...

https://www.example.com/categorybase/category/https:/www.example.com/categorybase/category/page/250/




[edited by: not2easy at 1:04 am (utc) on Feb 13, 2018]
[edit reason] readability [/edit]

12:39 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: 684
votes: 4


I have used Wordpress 2017 and same problem
cannot see anything wrong with htaccess (although not sure what to look for...)
12:41 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: 684
votes: 4


htaccess
RewriteOptions inherit

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress




[edited by: not2easy at 1:02 am (utc) on Feb 13, 2018]
[edit reason] readability [/edit]

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

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4055
votes: 249


There's nothing in the source code like an old base href= tag is there? Not something WP would cause, but it is not impossible that some plugin might add.
12:44 am on Feb 13, 2018 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


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

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


Can you try removing "RewriteOptions inherit"

This is inheriting other rewrite options from the server
12:51 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: 684
votes: 4


I have disabled all plugins and tried with Wordpress 2017 - not to say that an old plugin migt hav eleft some residue...
I assume you mean the html code of the correct page/url
I can see no reference of - href="https:/w etc - and only href="https://w etc
12:52 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: 684
votes: 4


Thanks SEO SKUNk - I looked at that.. not sure why that is there... will try that now on staging version..
12:55 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: 684
votes: 4


Removing "RewriteOptions inherit" makes no difference
I assume this false url should result in a 404?
1:00 am on Feb 13, 2018 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4055
votes: 249


There's a discussion about the nuances of various rewrites when changing from http: to https: protocols here: [webmasterworld.com...] and it is best though not required to leave a line between rules for readability. The WP snippet shown at the end always belongs after the last of the other rules, as you've done. And I'm assuming you've changed the WP URLs in the Settings.

Note - I have edited the few posts above with linked code to make it readable. That "[ " was inserted because with (dot), the system did not recognize example.com. Enclosing the code in [ code ] tags leaves it as written.

[edited by: not2easy at 1:07 am (utc) on Feb 13, 2018]

1:01 am on Feb 13, 2018 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


Yes it should resolve a 404, clear all cache

This line in htaccess

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ [%{HTTP_HOST}%{REQUEST_URI}...] [L,R=301]

Can you remove on staging server please not sure why "}...] " is there
1:07 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: 684
votes: 4


Removed this
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ [%{HTTP_HOST}%{REQUEST_URI}...] [L,R=301]

Does the first RewriteEngine On need to be there?

RewriteEngine On
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
1:08 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: 684
votes: 4


Tried in new browser and problem persists...
1:15 am on Feb 13, 2018 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


It only needs it once so

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

What's your base url say in header?
Also what version of wordpress?
1:21 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: 684
votes: 4


Sorry, I don't know what this means "What's your base url say in header? "?
The only base in source code relates to {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.4\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.4\/svg\/","svgExt":".svg","source":

On staging Wordpress is 4.9.4 and on live site 4.9.3
1:26 am on Feb 13, 2018 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


Do you have any caching on the server like varnish that could be caching the results?
1:28 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: 684
votes: 4


Siteground hosting... SG Cache I will clear that again now...
1:28 am on Feb 13, 2018 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


Try this go to problem url and add the following to the url after the last slash / "?browser=nocache12345" and see if you get a 404
1:32 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: 684
votes: 4


cleared cache - I assume you mean add as is - ?browser=nocache12345
done that and THAT url the resolves with the same content...
1:51 am on Feb 13, 2018 (gmt 0)

Senior Member

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

joined:Sept 14, 2011
posts:1045
votes: 132


I think we've checked everything, the only thing left is plugins.

Sometimes you do need to remove plugins to get rid of them completely. I would suggest you delete plugins one by one on the staging server.
5:35 am on Feb 13, 2018 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4055
votes: 249


One more - something I am not certain about myself - are you certain that "{REQUEST_URI}" does not return full path including domain name?

That's why I suggested visiting the Apache Forum discussion about rewrites to https - your htaccess is different from most I've seen. Where you use "{HTTPS} off" usually I've seen "{HTTPS} !=on" used. "!=on" means the same as "off" but the syntax is different, using "="

In the Apache forum, you could get a better answer.


1:43 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: 684
votes: 4


Have deleted all plugins...
and added just the following to the htaccess on the staging site (assuming that won't utilise main site htaccess?

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
2:04 pm on Feb 13, 2018 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member 10+ Year Member

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


What are your permalink settings?

Some themes can mess up pagination with a custom category or tag base in place. Literally just checked one of my sites to test this and found a problem with /blog/page/2/ not working properly.
2:14 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: 684
votes: 4


I did wonder if a page/category might have previously used the 'base' category name - so I changed the base category name to 'base' and the problem is still there... however - just playing around with not having a category base - which would mess up a whole lot of urls - and I cannot get either of the 3 categories to work... they redirect to posts with similar/same names in the url
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