How to check if search query contain some characters? For example I would like to check if search query contain "/".
I tried this answer but it is not working for me. Just to say I am using custom search base.
where "myseachbase" is my custom search base. What I need is way to check if search query has "/", in some cases it is at the end of search query, for example:
How to check for that ending "/" in search URL?
Problem is that I have some custom URLs like:
They are practically search results, even visitor open them by clicking on link(s), not by using normal site search.
I need to make them indexable only if:
- there are search results
- it is first search results page, not for any other /page/x
- search query has specific keyword(s)
- search results are correct and usefull results
- plus to add some quality content prepared by editor based on search keyword
After I have done that part, I have nice quality content, custom text based on search query + some images (images are search results) on URLs like:
but, if you add "/" at the you will get same page, but another URL, which will met conditions to be indexable too. So, I need way to put "noindex" tag in case if it is that duplicate URL, URL with "/" at the end, because I have no option to create canonicial URL. For that I need something to check for "/".