-
AuthorPosts
-
July 14, 2015 at 12:41 pm #330083
Hi,
I am writing in as I have had a strange issue with .htaccess on a new site powered by X. I have migrated the site to the hosting company using backupbuddy and await DNS changes to be made by the client.
I did get a warning message from backupbuddy when importing the site as follows: An AddHandler directive has been found in your .htaccess file. This could result in WordPress and PHP not running properly if configured improperly, especially when migrating to a new server. If you encounter problems such as an Internal Server Error or Error 500, try removing this line from your .htaccess file. Line: “AddHandler application/x-httpd-php56 .php .php5 .php4 .php3 “.When testing the site by IP with the help of the hosting company (siteground) they had to overwrite the .htaccess file with a standard file for the site to work.
Can you tell me what the correct settings for .htaccess should be please so i don’t have a nasty surprise with my client when the DNS for the site are changed to the new site. Thanks in advance.
See all the details below
This is the content of the .htaccess the hositng company have now set:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPressThis is the .htaccess which came over with the site using backupbuddy – Note the last line of code “AddHandler application/x-httpd-php56 .php .php5 .php4 .php3” has been somehow removed from this file in the process
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule># END WordPress
# compress text, html, javascript, css, xml:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
AddType image/png .png
</IfModule>## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
</IfModule>
## EXPIRES CACHING ##This is the .htaccess as it was in the subdomain I was developing in and the site was working fine (you can still see the site there as I haven’t deleted it: http:/e-ha.co.uk/jddcourses) – note the “Addhandler” command at the bottom
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /jddcourses/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /jddcourses/index.php [L]
</IfModule># END WordPress
# compress text, html, javascript, css, xml:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
AddType image/png .png
</IfModule>## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
</IfModule>
## EXPIRES CACHING ##AddHandler application/x-httpd-php56 .php .php5 .php4 .php3
There is also another .htaccess file with this single line of code: AddHandler application/x-httpd-php56 .php .php5 .php4 .php3 but it is located in the root i.e. outised of the publi-html directory.
July 14, 2015 at 1:49 pm #330172Hi there,
Thanks for writing in! You can replace your .htaccess file with this one:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /x4.0/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /x4.0/index.php [L] </IfModule> # END WordPress
This is the default .htaccess for WordPress, another way is that you can rename your .htaccess to .htaccess1 and new .htaccess file will be generated automatically.
Let us know how this goes!
-
AuthorPosts