Categoría: Tecnología al Día
If you need to change the way your PHP is working you can do that using .htaccess. Please, note that not all PHP options can be changed using .htaccess. A list of options that can be changed using .htaccess file can be found at: http://www.php.net/manual/en/ini.php#ini.list The ones that can be changed with .htaccess are the
By default most web servers across the internet are configured to treat as PHP files only files that end with .php. In case you need to have your HTML files parsed as PHP (e.g .html) or even if you want to take it further and make your PHP files look like ASP, you can do
In case your web hosting account is not configured to server certain mime types with the proper content type. You can change this using .htaccess file. For example if you need to configure your server to display ASX files: AddType video/x-ms-asf asf asx For windows media audio WMA AddType audio/x-ms-wma .wma A comprehensive list of
ModRewrite is a powerful feature of the Apache web server. It provides an easy way to modify/manipulate URLs. As complicated as it sounds a regular webmaster can benefit from this feature in many way. I will list here the ones I consider most useful for the regular webmaster. Create easy to remember URLs or also
Most probably you have been wondering how the Webserver decides which page from your site to use as a main/default page of your site. There is a directive named DirectoryIndex which takes care of this. On most web servers there is a pre-defined set of file names which server a start page. The most commonly
In case your web hosting account is not configured to server certain mime types with the proper content type. You can change this using .htaccess file. For example if you need to configure your server to display ASX files: AddType video/x-ms-asf asf asx For windows media audio WMA AddType audio/x-ms-wma .wma A comprehensive list of
As .htaccess is a powerful tool. It gives you option to change the way the webserver serves your files. On most web hosting servers you can use SSI (Server Side Includes) in shtml, or shtm files. However, you need to use SSI in your .html and htm files. There is an easy solution for this.
If you have several domain names parked/pointed at your site it is a good idea to create permanent 301 redirect for them so for the search engines not to treat them as duplicate content. Here is a sample .htaccess that will do that: RewriteEngine on RewriteCond %{HTTP_HOST} ^parkeddomain.com$ [OR] RewriteCond %{HTTP_HOST} ^parkeddomain-2.com$ RewriteRule ^(.*)$ http://www.maindomain.com/$1
Sometimes you may need to make sure that the user is browsing your site over securte connection. An easy to way to always redirect the user to secure connection (https://) can be accomplished with a .htaccess file containing the following lines: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] Please, note that the .htaccess
ModRewrite is a powerful feature of the Apache web server. It provides an easy way to modify/manipulate URLs. As complicated as it sounds a regular webmaster can benefit from this feature in many way. I will list here the ones I consider most useful for the regular webmaster. Create easy to remember URLs or also