Title: WordPress server move
Last modified: September 1, 2016

---

# WordPress server move

 *  Resolved [machielr](https://wordpress.org/support/users/machielr/)
 * (@machielr)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-server-move/)
 * Hi All
 *  I am really hoping that someone can assist ( I may have posted this question
   to the wrong group previously) .
 *  We are running wordpress 4.5.2 and apache 2.2 , however we now need to move 
   all sites to a new server running apache version 2.4.7
 *  We have edited the apache vhost to include the “require all granted” and mod_rewrite
   is enabled.
 *  However when we try to connect to the wordpress site on the new server we get
   an internal error page.
 *  The logs shows us the following :
    /.htaccess: <IfModule not allowed here
 *  We have been looking for a solution on this for a while now and we now only 
   have a week left for our move.
 *  The problem we are facing is that the ifMOdule entry is written to the .htaccess
   file by WordPress automatically and even if we remove that section from htaccess,
   it gets overwritten.
 *  Can anyone perhaps help us out in terms of how to resolve this issue.
 *  I would really appreciate any help as I am not too familiar with WordPress and
   I am also unable to find any settings where this can be changed or disabled from
   the admin pages or config files.
 * Regards

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [mdowden](https://wordpress.org/support/users/mdowden/)
 * (@mdowden)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-server-move/#post-7488866)
 * You should also include in the vhost AllowOveride All
 * <Directory “your path”>
    AllowOverride All Require all granted </Directory>
 * Also go into the default conf file /etc/apache2/httpd.conf and switch AllowOveride
   All and Require all granted
 *  Thread Starter [machielr](https://wordpress.org/support/users/machielr/)
 * (@machielr)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-server-move/#post-7488884)
 * The directory sections are already created as stated above.
 * The httpd.conf file is empty and the apache2.conf file do not have any references
   to allowoverride at all.
 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-server-move/#post-7488931)
 * Can you post the contents of the .htaccess file that is causing the error?
 * FYI, the Require directive must be enclosed in a <Directory> or <RequireAll> 
   block if it is used in a VirtualHost section.
 * Also FYI, it is unwise to set AllowOverride All globally, and it is good practice
   to use AllowOverride to enable only the modules required in the .htaccess files.
   This will limit the potential damage in the event your site is hacked.
 *  Thread Starter [machielr](https://wordpress.org/support/users/machielr/)
 * (@machielr)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-server-move/#post-7489019)
 * Hi, please find below the htaccess file that is causing the problem:
 * # 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 WordPress
 * herewith the current <directory> directives in the vhosts file for this site
 *  <Directory /var/www/<site>/www/>
    Allowoverride All #AllowOverride AuthConfig
   Require all granted allow from all #Options FileInfo </Directory>
 * As you can see we have only added AllowOverride all in order to try and trace
   the issue as it was previously set to AuthConfig only.
 * We have a total of 4 wordpress sites and all giving the same problem.
 * All of these sites are running the same versions of wordpress, etc…
 * Regards
 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-server-move/#post-7489030)
 * THe first thing I’d suggest is to remove the trailing slash in the <Directory
   > line. Trailing slashes mean different things to different operating systems,
   and since you didn’t say which operating system you’re using, it’s better to 
   be safe than sorry. 🙂
 * Second, I don’t know if it’s a transcription error or not, but the line “Allowoverride
   All” should be “AllowOverride All”.
 * And third, “allow from all” should be removed. It too is capitalized incorrectly,
   but more important, the directive is not supported in Apache 2.4.x unless the
   _access\_compat_ module is loaded.
 *  Thread Starter [machielr](https://wordpress.org/support/users/machielr/)
 * (@machielr)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-server-move/#post-7489034)
 * Hi
 *  ok all the changes suggested has made absolutely no difference at all.
 *  However, what I ended up doing is to move all the content from the .htaccess
   file into the vhost file under the Directory directive and them moved the .htaccess
   file to a different location for testing. This seems to have resolved the problem
   for now as it is now allowed the site to start up properly and still works after
   a restart.
 *  I am however still concerned that a future update on wordpress may place all
   these directives back into an htaccess file or need to add more options and it
   is then not working as expected.
 *  the htaccess file was after all created by wordpress during installation and
   thus my concern is when the next updates are don, what will happen.
 *  From all the info I was able to find thus far it plain and simple came down 
   to the following :
 *  Apache 2.4.7 does not allow the <ifModule> directives inside the .htaccess files
   any more and thus it will no longer allow a site to start up with this directive
   in there.
 *  Now my next question, how will wordpress handle this issue in future? how can
   we log this as a bug in order for it to be looked at for future versions?
 * Regards
 *  Thread Starter [machielr](https://wordpress.org/support/users/machielr/)
 * (@machielr)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-server-move/#post-7489036)
 * Hi guys
 *  Please ignore my previous comments as I have managed to find the issue causing
   the problem in the first place.
 *  The actualy directory where we were specifying the AlloOverride directives and
   the .htaccess file it was trying to read was in different directories.
 *  My last changes made me suddenly realise that I have not been reading the directory
   properly and thus my directives were setup for the wrong directories.
 *  The issue on my side is now resolved.
 * Regards

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘WordPress server move’ is closed to new replies.

 * In: [Localhost Installs](https://wordpress.org/support/forum/localhost-installs/)
 * 7 replies
 * 3 participants
 * Last reply from: [machielr](https://wordpress.org/support/users/machielr/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/wordpress-server-move/#post-7489036)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
