Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable X-Powered-By on OVH mutualized server using apache?

I tried to disable both X-Powered-By and Server for security concerns by adding the following to my .htaccess in a OVH mutualized server.

<IfModule mod_headers.c>
  # Security disable headers. http://www.shanison.com/2012/07/05/unset-apache-response-header-protect-your-server-information/
  Header unset Server
  Header unset X-Powered-By
</IfModule>

But it doesn't work, I still get these headers when running HTTP requests. Why? It is not possible because somehow the mod_headers.c is not loaded on a mutualized server?

like image 332
Vadorequest Avatar asked Sep 13 '14 10:09

Vadorequest


People also ask

How do I get rid of X-powered-by HTTP response header?

Open the site which you would like to open and then click on the HTTP Response Headers option. Click on the X-Powered-By header and then click Remove on the Actions Pane to remove it from the response.


2 Answers

There is a PHP function as well which is able to do this:

<?php
header_remove("X-Powered-By");
?>

http://php.net/manual/en/function.header-remove.php

Hope this help

like image 83
VishalParkash Avatar answered Oct 03 '22 14:10

VishalParkash


you can add these lines to your .htaccess

Header always unset X-Powered-By
Header unset X-Powered-By
like image 36
Rachid Loukili Avatar answered Oct 03 '22 16:10

Rachid Loukili