Spammer Links

tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: Spammer Links

Post 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; ?>" />
admin
Site Admin
Posts: 37250
Joined: Wed Sep 10, 2008 11:43 am

Re: Spammer Links

Post by admin »

as you can see it's in your template
all you need to do is to change your code here
Don't forget to run script update
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: Spammer Links

Post by tubeman »

Is the code correct that I am using? What do I change the code to?
admin
Site Admin
Posts: 37250
Joined: Wed Sep 10, 2008 11:43 am

Re: Spammer Links

Post 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? )
Don't forget to run script update
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: Spammer Links

Post 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.
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: Spammer Links

Post by tubeman »

How do I do the canonical link correctly?
admin
Site Admin
Posts: 37250
Joined: Wed Sep 10, 2008 11:43 am

Re: Spammer Links

Post by admin »

what is 'correct' in this case?
Don't forget to run script update
tubeman
Posts: 534
Joined: Sat Mar 02, 2013 11:33 am

Re: Spammer Links

Post 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?
admin
Site Admin
Posts: 37250
Joined: Wed Sep 10, 2008 11:43 am

Re: Spammer Links

Post by admin »

echo $req;

replace with

echo str_replace('index.php', '', $req);
Don't forget to run script update
Post Reply