• Resolved tonybemidji

    (@tonybemidji)


    Greetings…

    We’re running WP 4.1.1 on a Mac server using Apache. Works great… https://www.bemidji.k12.mn.us

    We are using .htaccess to handle permalinks.

    I am testing a Disaster Recovery in which I move everything over to a system running Centos 7 with Apache, MYSQL, PHP, etc. all installed and working.

    The default web directory on the Centos server is /var/www/html. So for the test, I restored my backup to /var/www/html on the Centos server. This included the .htaccess file. I then restored the database to the MYSQL server on the Centos server which has the same database name, same username and password.

    I can get to the homepage of the transferred website, but if I click any of the links in the header I get “The requested URL /url/ was not found on this server”.

    Mod-Rewrite is loaded on the new box. Not sure what I might be missing.

    Any ideas appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • bernbe01

    (@bernbe01)

    hey there

    a thought on this, are you able to access /wp-login.php or /wp-admin on the centos server?

    if yes, try resaving your permalink structure (Dashboard->Settings->Permalinks) and take a look at the generated .htaccess file.

    then i’d use a toold like diffchecker to compare each htaccess file. is the .htaccess file generated when you save permalinks on the centos box the same as the one on your MAMP server?

    if you are unable to access /wp-admin, temporarily remove your .htaccess file and/or place the default settings from here in it

    # 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
    Thread Starter tonybemidji

    (@tonybemidji)

    Thanks for the reply bernbe01…

    I am able to get to wp-login. I renamed the existing .htaccess to .htaccesstemp and then went to the Permalinks settings and saved. I get the message that the permalink structure has been updated, but the .htaccess file is not created in /var/www/html on the Centos system. I even changed permissions on that directory to 777 just to be sure I could write to it.

    I feel like I’m missing something pretty basic here.

    This is the WordPress section of the functioning production .htaccess file:

    # BEGIN WordPress
    <ifModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </ifModule>
    # END WordPress
    bernbe01

    (@bernbe01)

    how’d it go with *just* the .htaccess lines provided?

    you could also try resetting all perms to default 755 for dirs and 644 for files using:
    *be sure to change the path to match yours

    # find /path/to/wordpress -type d -exec chmod 755 {} \;
    # find /path/to/wordpress -type f -exec chmod 654 {} \;

    is the folder structure owned by the apache user?

    when in /var/www do

    # ls -al

    and look at the owner for html dir

    then cd into html and do the same

    ensure that the user is the same as who apache runs as, to find that out

    # ps aux |grep apache
    or
    # ps aux |grep httpd

    i’m still thinking permissions, but based on what we find here we may go another route ??

    Thread Starter tonybemidji

    (@tonybemidji)

    Finally figured it out.

    I forgot to change the AllowOverride parameter for /var/www/html on the Centos system. Made that change and everything is looking good.

    Thanks for the help bernbe01 … It was a good reminder to make the permissions changes, etc.

    bernbe01

    (@bernbe01)

    nice work finding&fixing that!

    thanks for updating the thread! feel free to mark it as resolved if you are all set

    cheers!

    Thread Starter tonybemidji

    (@tonybemidji)

    Resolved!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Troubleshooting DR Options Moving WordPress Site’ is closed to new replies.