Page 2 of 2
Re: Spammer Links
Posted: Tue May 05, 2020 2:01 pm
by tubeman
Hi,
Right now like this:
<link rel="canonical" href="http://<?php echo $_SERVER['HTTP_HOST']?><?php list($req, $params) = explode('?', $_SERVER['REQUEST_URI']); echo $req; ?>" />
Re: Spammer Links
Posted: Wed May 06, 2020 6:55 am
by admin
as you can see it's in your template
all you need to do is to change your code here
Re: Spammer Links
Posted: Wed May 06, 2020 10:10 am
by tubeman
Is the code correct that I am using? What do I change the code to?
Re: Spammer Links
Posted: Wed May 06, 2020 10:15 am
by admin
I've never seen this code before, i have no idea how it supposed to work
may be it's easier to ask the one who wrote it? )
Re: Spammer Links
Posted: Wed May 06, 2020 2:30 pm
by tubeman
admin wrote: Mon Nov 11, 2019 1:57 pm
Well, you output REQUEST_URI .. what did you expect ..?
you can split it like
list($req, $params) = explode('?', $_SERVER['REQUEST_URI']);
echo $req;
Earlier in the ticket you mentioned it.
Re: Spammer Links
Posted: Wed May 06, 2020 2:34 pm
by tubeman
How do I do the canonical link correctly?
Re: Spammer Links
Posted: Wed May 06, 2020 2:53 pm
by admin
what is 'correct' in this case?
Re: Spammer Links
Posted: Wed May 06, 2020 3:32 pm
by tubeman
Now in canonical url for:
http://www.domain.com/index.php?page=post
It shows canonical url :
http://www.domain.com/index.php
How to make it show:
http://www.domain.com
Code I am using is:
<link rel="canonical" href="http://<?php echo $_SERVER['HTTP_HOST']?><?php list($req, $params) = explode('?', $_SERVER['REQUEST_URI']); echo $req; ?>" />
What would be correct code?
Re: Spammer Links
Posted: Wed May 06, 2020 3:39 pm
by admin
echo $req;
replace with
echo str_replace('index.php', '', $req);