Tag: htaccess
Swapping between php versions when using suPHP and CLI with custombuild
by admin on Sep.07, 2009, under DirectAdmin
If you have both suPHP and CLI installed on your system, but don’t feel like renaming all of your file.php to file.php4 (for example), there is another means to chose between php versions, without requiring to touch your php files.
To force php files to use CLI (on the assumption your default php version uses suPHP) create an .htaccess file in your public_html directory, with the following:
<FilesMatch "\.php$">
AddHandler application/x-httpd-php .php
</FilesMatch>
To force php files to use suPHP (on the assumption your default php version uses CLI) use the following:
<FilesMatch "\.php$">
AddHandler x-httpd-php5 .php
</FilesMatch>
This last one is on the assumption that php 5 is suPHP and CLI is php4. If php4 was suPHP, then you’d use x-httpd-php4 to force .php files to use suPHP with php 4.
Hotlink protection: How-To prevent people from stealing your files
by admin on Sep.07, 2009, under DirectAdmin
Create an .htaccess file in your public_html directory with the following code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com.*$ [NC]
RewriteRule .(gif|jpg)$ – [F]
Where domain.com is your domain.
Running CGI script from any directory or via /~username/cgi-bin
by admin on Sep.07, 2009, under DirectAdmin
In order to force apache to allow cgi script to run, simply create a file called .htaccess inside the directory in which you wish to run the scripts. Insert this text into the file:
Options +ExecCGI
AddHandler cgi-script .cgi .pl
cPanel 11 Documentation – Front Page Extensions
by admin on Jan.03, 2009, under Tutorial, cPanel
Overview
FrontpageĀ® Extensions allow you to publish your site directly from the FrontPageĀ® application. This means that you will not have to upload files through FTP, or another method.
Installing or uninstalling FrontpageĀ® Extensions will result in the loss of all “.htaccess” files in your web area. Any changes you have made to your “.htaccess” files will be lost. Any directories you have protected with WebProtect will become unprotected until you re-protect them.
When the page loads, you will see a table containing the following information, split into three columns:
- Domain – This column will show all the domain you have associated with your web hosting account.
- Status – This column will show the status of FrontPage Extensions installation for the domain in reference. There will be two status labels displayed:
- installed – This means FrontPage extensions have been installed on the domain in reference.
- not installed – This means FrontPage extensions have not been installed on the domain in reference.
- Functions – This column provides two buttons that change according to the Status of the domain in reference. For example, if FrontPage extensions are installed for a domain, the two buttons that will be displayed are as follows:
- Reinstall Extensions – This button appears if you already have FrontPage extensions installed for the domain in reference. Click this button to reinstall FrontPage extensions. Occasionally FrontPage extensions may not work properly. If you run into this problem, use this button to reinstall the extensions.
- Uninstall Extensions – This button appears if you already have FrontPage extensions installed for the domain in reference. Click this button to uninstall FrontPage extensions.
If the Status for the domain in reference shows “not installed”, the two buttons that will be displayed are as follows:
- Install Extensions – This button appears if you do not already have FrontPage extensions installed for the domain in reference. Click this button to install FrontPage extensions.
- Cleanup Old Extensions – This button appears if you do not already have FrontPage extensions installed for the domain in reference. If you have previously installed and uninstalled FrontPage extensions for the domain in reference, use this button to wipe the domain’s account clean of any FrontPage extensions that may have been left behind during the removal of the FrontPage extensions.
