DEV Community

Daniele Scasciafratte
Daniele Scasciafratte

Posted on • Originally published at daniele.tech on

How to set X-Robots-Tag in htaccess for any query string

It is just a note for me to remember this trick:

RewriteCond %{QUERY\_STRING} . RewriteRule .\* - [E=MY\_SET\_HEADER:1] [QSD,R=302,L] 
Header set X-Robots-Tag "noindex, nofollow" env=MY\_SET\_HEADER
Enter fullscreen mode Exit fullscreen mode

It is based on the suggestion here but with a change to support if there is any query string in the URL. [...]

Read More...

The post How to set X-Robots-Tag in htaccess for any query string appeared first on Daniele Mte90 Scasciafratte.

Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

Image of Stellar post

How a Hackathon Win Led to My Startup Getting Funded

In this episode, you'll see:

  • The hackathon wins that sparked the journey.
  • The moment José and Joseph decided to go all-in.
  • Building a working prototype on Stellar.
  • Using the PassKeys feature of Soroban.
  • Getting funded via the Stellar Community Fund.

Watch the video 🎥

👋 Kindness is contagious

Explore this insightful post in the vibrant DEV Community. Developers from all walks of life are invited to contribute and elevate our shared know-how.

A simple "thank you" could lift spirits—leave your kudos in the comments!

On DEV, passing on wisdom paves our way and unites us. Enjoyed this piece? A brief note of thanks to the writer goes a long way.

Okay