Absolute vs. Relative URL

Everything related to CCount PHP click counter
Post Reply
bhl
Posts: 2
Joined: Thu Dec 26, 2024 5:18 pm

Absolute vs. Relative URL

Post by bhl »

Greetings,

I manage a website that uses relative URLs for all local content. For example: page_1/php instead of https://website.com/page_1.php.

The problem I see when creating a new link is that CCount requires you to enter an absolute URL and the generated URL is also absolute.

How do I update the relative URL such that CCount will function without having to replace the relative URL with an absolute URL?
Klemen
Site Admin
Posts: 10114
Joined: Fri Feb 11, 2005 4:04 pm

Re: Absolute vs. Relative URL

Post by Klemen »

The URL you enter into CCount must be an absolute one, starting with http(s)://

The generated URL can be used either as a relative or absolute one, so both these should work:
https://example.com/ccount/click.php?id=1
ccount/click.php?id=1

But, honestly, I think you are loosing time and effort over irrelevant details (relative vs absolute).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
bhl
Posts: 2
Joined: Thu Dec 26, 2024 5:18 pm

Re: Absolute vs. Relative URL

Post by bhl »

Thank you. That is what I was looking for. I will test it out. The reason I can't have a bunch of absolute URLs is that during local testing absolute links point to the live site.
Post Reply