Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
Autumn, 28 Oct 2026 - @361.31
Forum Activity: Three Stars Random | Recent Posts | Guild Recents
News: :skull: Websites are like whispers in the night  :skull: Guild Events: Halloween Watch-a-thon
Super News: ~~MelonLand's Halloween Profile Design Contest 2026~~
+  MelonLand Forum
|-+  Da Web Revival
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  Show different things based on user agent


« previous next »
Pages: [1] Print Embed
Author Topic: Show different things based on user agent  (Read 524 times)
Noah_S
Sr. Member ⚓︎
****
View Profile WWWArt


Noah. Earth. I make website. I.. I.. Noah. Earth.
⛺︎ My Room
iMood: Noah_S
RSS: RSS

Guild Memberships:
Artifacts:
Caught by RubbereonfunguyVisited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!I met Dan Q on Melonland!A coin!
« on: Autumn, 12 Sep 2026 @873 » Toggle Font Embed

Is there a way to check the user agent and if it's, let's say GPTBot, show it an error page instead of the actual page?

My host supports PHP.

Logged

perfectionist_better.gifweb_designer.gifspeed_of_time.gifbutton290.pngmy_dream_wedding.gifClippy beats AI

Artifact Swap: Christmas Easter. Or Easter Christmas?Fake penguinLarge watercraftGrowing ballwhen life gives you crab make mailMessage BuddylaptopYarn kitty
Rubbereon
Sr. Member ⚓︎
****
View Profile WWWArt


⛺︎ My Room
SpaceHey: Friend Me!
Matrix: Chat!
XMPP: Chat!
OS: Linux 🐧

Guild Memberships:
Artifacts:
NoSmoking!Hope, the silliest ink kittayyVisited on Melon's 10th Anniversary!Joined 2025!
« Reply #1 on: Autumn, 12 Sep 2026 @880 » Embed

I downloaded this last year, but ended up not even using it.
https://rafael.adm.br/css_browser_selector/

Despite the name it does pretty much what you want because it detects the operating system and browser of the user.

The problem is that Linux's default fonts are different from Windows yeah right this is obvious! I mean my website (at least the homepage) is themed around classic Windows, so it'd be a bit of an issue if Linux uses Noto Sans instead of Times New Roman, but even then I kind of forgot about it and am thinking of a way to solve this issue with css only in case somebody runs noscript which would break the whole setup. :ohdear:

I think javascript is required though, so may wanna make a default page with <noscript> tags in case the javascript breaks.

Logged

https://bettysgraphics.neocities.org/images/animals/cat%20695.gifFuzzy fwiendhttps://bettysgraphics.neocities.org/images/animals/cat%20696.gifhttps://bettysgraphics.neocities.org/images/animals/cat%20697.gif
https://rubbereon.nekoweb.org/img/penguin.gifLinux userhttps://rubbereon.nekoweb.org/img/penguin.gif
↓ All my web profiles are available on this website ↓
https://fursona.directory/@rubbereon :goL:
https://rubbereon.nekoweb.org/img/tabs.gifhttps://rubbereon.nekoweb.org/img/idiotsticker.pnghttps://rubbereon.nekoweb.org/img/iblockads.gif

Artifact Swap: Kitty playing HopscotchGreen Spiffo:DJust CheeseMerry Christmassmileymamimigu danceNow thats a great sun
Rubbereon
Sr. Member ⚓︎
****
View Profile WWWArt


⛺︎ My Room
SpaceHey: Friend Me!
Matrix: Chat!
XMPP: Chat!
OS: Linux 🐧

Guild Memberships:
Artifacts:
NoSmoking!Hope, the silliest ink kittayyVisited on Melon's 10th Anniversary!Joined 2025!
« Reply #2 on: Autumn, 12 Sep 2026 @886 » Embed

GPTBot
Ah also GPTbots can't run javascript nor css at all, so you could show them a blank page while your regular users could see your webpage as normal, but I am getting off-topic.

If you have php I presume you have an .htaccess file too, you can block the bot by blacklisting its useragent, there's a website that even details everything you need to know about that.
https://perishablepress.com/ultimate-htaccess-blacklist/

Logged

https://bettysgraphics.neocities.org/images/animals/cat%20695.gifFuzzy fwiendhttps://bettysgraphics.neocities.org/images/animals/cat%20696.gifhttps://bettysgraphics.neocities.org/images/animals/cat%20697.gif
https://rubbereon.nekoweb.org/img/penguin.gifLinux userhttps://rubbereon.nekoweb.org/img/penguin.gif
↓ All my web profiles are available on this website ↓
https://fursona.directory/@rubbereon :goL:
https://rubbereon.nekoweb.org/img/tabs.gifhttps://rubbereon.nekoweb.org/img/idiotsticker.pnghttps://rubbereon.nekoweb.org/img/iblockads.gif

Artifact Swap: Kitty playing HopscotchGreen Spiffo:DJust CheeseMerry Christmassmileymamimigu danceNow thats a great sun
Seechain
Jr. Member ⚓︎
**
View Profile WWW


⛺︎ My Room
Itch.io: My Games

Artifacts:
Joined 2026!
« Reply #3 on: Autumn, 12 Sep 2026 @930 » Embed


If you have php I presume you have an .htaccess file too, you can block the bot by blacklisting its useragent, there's a website that even details everything you need to know about that.
https://perishablepress.com/ultimate-htaccess-blacklist/

 :omg: I read .htaccess and a lot of memories got unlocked for me, you can do a lot of tricks with that file, for example redirecting to the mobile version of a site based on the user agent, so I think it would work the same for a bot.

Logged

Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 Melon
Land
Forum Art Hub Chat Webring Explore Random Recent Tenement Arcade Want to Login or Join ? Web Craft Guide Graphic Catalogue Wiki Help I'm Lost! Link Land Newsletters Image Stream Minecraft: Online
Zap!
Passport Sites tamaNOTchi Asatte Add your site?
Aero Archive Onio Cafe 32 Bit Cafe Status Cafe