Meta 13 Project Blog
  • Home
  • Links
  • CMS
  • CSS
  • Ecom
  • Email
  • Flash
  • Google
  • HTML
  • Javascript
  • OS
  • PHP
  • SEO
  • SQL
Browse: Home / .htaccess

.htaccess

Increase the Maximum File Upload Size

By Bryce on November 17, 2011

If it can’t be done at the server level here are some options for increasing upload files size from the front end.

Theme Functions File

An option for WordPress. Add these to your themes functions.php file.

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

Create or Edit an existing PHP.INI file

In most cases if you are on a shared host, you will not see a php.ini file in your directory. If you do not see one, then create a file called php.ini and upload it in the root folder. In that file add the following code:

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

htaccess Method

Open or create the .htaccess file in the root folder and add the following code:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

There are cases where we have seen that just by adding the following code in the theme function’s file, you can increase the upload size:

1 @ini_set( 'upload_max_size' , '64M' );
2 @ini_set( 'post_max_size', '64M');
3 @ini_set( 'max_execution_time', '300' );

Posted in Code, PHP | Tagged .htaccess, php.ini, WordPress | 1 Response

Force download of a file rather than display in browser using htaccess

By Jason on April 27, 2011

<FilesMatch "\.(tif|TIF)">
Header set Content-Disposition attachment
</FilesMatch>

Posted in HTML, Linux | Tagged .htaccess, attachment, download | Leave a response

Avoid Duplicate Content By Forcing WWWs

By Bryce on September 30, 2010

A website should either force www onto its url structure or remove them as to not be flagged as duplicate content. One of the following should be added to the sites .htaccess file.

Force WWWs

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^website.com$ [NC]
RewriteRule ^(.*)$ http://www.website.com/$1 [R=301,L]
</IfModule>

Remove WWWs

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.website.com$ [NC]
RewriteRule ^(.*)$ http://website.com/$1 [R=301,L]
</IfModule>

Some CMS’ will do this automatically.

Posted in SEO | Tagged .htaccess | Leave a response

Tags

.htaccess Advanced Custom Fields Bower c5 cms Composer Concrete 5 Concrete5 Cron CSS3 Cycle Cycle2 fancybox FancyBox2 Foundation Genesis Google Fonts Google Maps Google Webfonts Google Web Fonts Gravity Forms Grunt html5 HTML5 Boilerplate IE7 iPad iPhone jQuery lightbox Lists Magento Media Queries mobile pdf Plesk PrettyPhoto Responsive SASS SCSS static block Twitter typekit Video WordPress YouTube

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Recent Comments

  • Bryce on Responsive Email Templates
  • Justin on Mail Server Settings (Microsoft365)
  • Justin on Mail Server Settings (Microsoft365)
  • Bryce on Mail Server Settings (Microsoft365)
  • Justin on Mail Server Settings (Microsoft365)

Authors

  • Aaron Huisinga
  • Bryce
  • Darin
  • Jason
  • Josh
  • Justin
  • master
  • Nathan
  • nick
  • Paul

Archives

  • March 2016
  • July 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • September 2014
  • July 2014
  • June 2014
  • May 2014
  • December 2013
  • November 2013

Copyright © 2023 Meta 13 Project Blog. Powered by WordPress and Hybrid.