How to hide the source view of a page with htaccess?

346 Views Asked by At

As I said in the title, how to hide the source view of a page with htaccess ? Like that:

(fake code) IF [URL START WITH "view-soure"] - DONT_SHOW_CODE_PLZ
1

There are 1 best solutions below

3
Quentin On

You can't.

The view-source: URL prefix is handled internally by the browser.

The server doesn't get to see it, so server-side code can't trigger based on it.