Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
September 13, 2026 - @995.71
Activity rating: Four Stars Posts & Arts: 84/1k.beats Random | Recent Posts | Guild Recents
News: :cry: Are u having fun? Guild Events: weekly zine theme 11: tools

+  MelonLand Forum
|-+  Life & The Web
| |-+  ✁ ∙ 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 58 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:
funguyVisited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!I met Dan Q on Melonland!A coin!Enby
« on: September 12, 2026 @873.50 » 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: Large watercraftGrowing ballwhen life gives you crab make mailMelonland has encountered a bugMerry ChristmasMessage Buddy
Rubbereon
Sr. Member ⚓︎
****
View Profile WWWArt


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

Guild Memberships:
Artifacts:
Caught by Rubbereon!Caught by Rubbereon!Caught by Rubbereon!Caught by Rubbereon!Caught by Rubbereon!Caught by Rubbereon!
« Reply #1 on: September 12, 2026 @880.38 » 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 :eyes:

Artifact Swap: <html>pearl yappin kittayGreen SpiffoJust CheeseTomato SliceCreampuff
Rubbereon
Sr. Member ⚓︎
****
View Profile WWWArt


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

Guild Memberships:
Artifacts:
Caught by Rubbereon!Caught by Rubbereon!Caught by Rubbereon!Caught by Rubbereon!Caught by Rubbereon!Caught by Rubbereon!
« Reply #2 on: September 12, 2026 @886.26 » 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 :eyes:

Artifact Swap: <html>pearl yappin kittayGreen SpiffoJust CheeseTomato SliceCreampuff
Seechain
Jr. Member ⚓︎
**
View Profile WWW


⛺︎ My Room
Itch.io: My Games

Artifacts:
Joined 2026!
« Reply #3 on: September 12, 2026 @929.58 » 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
Editor Recent Edits Tenement Arcade Random Link Land → Forum Art Hub Chat Webring Want to Login or Join ? Web Craft Guide Graphic Catalogue Wiki Newsletters Image Stream
Passport Sites Asatte Add your site?
Zap!
Minecraft: Online
Who: PrinceDora