0

I want my shared web server to process ".ncs" files just like ".php" files. I know this can be easily done by adding an entry in Apache Handler. Ref: http://php.net/manual/en/security.hiding.php

But as I have mentioned that I am using shared hosting, any changes made by me on Apache Handler will not work. Those lists are just for reference. I opened a ticket in my website provider's support panel and they told me that I should use .htaccess file for that. But I am unable to understand that how I may use .htaccess file to process .ncs files just like .php files.

2

1 Answer 1

2

You need to use a AddType handler on the htaccess of the root of your server:

AddType application/x-httpd-php .ncs

BUT if you're running PHP as CGI, you need to use AddHandler too:

AddType application/x-httpd-php .ncs
AddHandler application/x-httpd-php .ncs
Sign up to request clarification or add additional context in comments.

4 Comments

This is what my .htaccess file of root directory has: <IfModule mod_deflate.c> SetOutputFilter DEFLATE <IfModule mod_setenvif.c> BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary </IfModule> <IfModule mod_headers.c> Header append Vary User-Agent env=!dont-vary </IfModule> </IfModule> Where to add your suggested code snippet?
At the complete begining of the file.
I have tried it. But still nothing. The PHP server is still not evaluating statements of the pinfo.ncs file.
try with x-httpd-php5, sounds weird but the server could be configured differently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.