Skip to content

Instantly share code, notes, and snippets.

@arkenidar
Last active November 29, 2023 12:07
Show Gist options
  • Save arkenidar/80e05f8bf3c3115ae802748eb6d64aca to your computer and use it in GitHub Desktop.
Save arkenidar/80e05f8bf3c3115ae802748eb6d64aca to your computer and use it in GitHub Desktop.
Apache ".htaccess" configuration for e.g. Wordpress.org, UTF-8, PHP "extended" file handling (e.g. "style.css.php" as "style.css" (by PHP handler) BTW see also Sublime Text for "file.css.php" and or "file.js.php" ).
# Apache ".htaccess" configuration for e.g. Wordpress.org,
# UTF-8, PHP "extended" file handling
# (e.g. "style.css.php" as "style.css" (by PHP handler)
# BTW see also Sublime Text for "file.css.php" and or "file.js.php" ).
### https://gist.github.com/arkenidar/80e05f8bf3c3115ae802748eb6d64aca
### https://arkenidar.com/code/httpd_apache/_.htaccess
### https://help.servmask.com/2018/10/27/how-to-increase-maximum-upload-file-size-in-wordpress/
php_value upload_max_filesize 1000M
php_value post_max_size 1000M
php_value memory_limit 1500M
php_value max_execution_time 1200
php_value max_input_time 1200
### https://arkenidar.com/wordpress/wp-admin/options-permalink.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# scope: setting both UTF-8 and "handling" by PHP
# for html, php
AddDefaultCharset UTF-8
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php .html
###
# for css, js, etc.
# -> CSS
AddCharset UTF-8 .css
AddHandler application/x-httpd-php .css
<FilesMatch "\.css\.php$" >
Header set Content-type "text/css; charset=utf-8"
</FilesMatch>
<FilesMatch "\.css$" >
Header set Content-type "text/css; charset=utf-8"
</FilesMatch>
# -> JS
AddCharset UTF-8 .js
AddHandler application/x-httpd-php .js
<FilesMatch "\.js$" >
Header set Content-type "text/javascript; charset=utf-8"
</FilesMatch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment