Jump to content

if url contains "_" send to 404?


dj-kenpo

Recommended Posts

is it possible posible via a header to detect if the url (or $_get["title"] in my case) has underscores and if so send to the 404 page?

 

my old urls had underscore, the new ones use more standard dashes, and the bots are all still roaming the old pages (which don't work and have errors) so I'd like to tell them to not go there I guess via 404..

Link to comment
https://forums.phpfreaks.com/topic/62044-if-url-contains-_-send-to-404/
Share on other sites

is it possible posible via a header to detect if the url (or $_get["title"] in my case) has underscores and if so send to the 404 page?

 

my old urls had underscore, the new ones use more standard dashes, and the bots are all still roaming the old pages (which don't work and have errors) so I'd like to tell them to not go there I guess via 404..

 

Sure, but a better thing to do would 301 the bots to the new page.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.