0

I saw this question on another post but was unable to add an answer because my reputation is too low. So I thought I would create a new thread.

  • So I migrated a website from a draft server to a live server.
    • I copied the website folder from the draft server and pasted into the live server.
    • I copied the website database, created a new database in mysql in the live server, and pasted the copied database in the new database folder in phpmyadmin
    • I updated the website address from the draft url to the live url in the wp_options folder in phpmyadmin.
    • I updated the two siteurls in the config.php file in cpanel file manager

After all this was done I found that only the website homepage was working and none of the links were working. So I went to wp-admin > Settings > Permalinks and selected save changes. And.. The problem was still happening (only homepage working). Answer is in the answer section.

  • Did you upload .htaccess as well? is rewrite mode enabled? what kind of error do you get? – Samuel Elh Sep 20 '17 at 23:06
  • This is already solved. I just didnt see the correct solution in anyother posts. Thanks though. – Justin Young Sep 22 '17 at 1:02
0

For those who may come along: In addition to your proposed answer, you can use the .htaccess file in your web root directory. These often get missed as they are hidden files on linux systems. You can check and make sure that was copied over, or make a new file and paste the rewrite rules into that. Here is an example of mine.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
-1

This was the solution

  • Go ftp or file manager
    • find the .htaccess file

Next: Change the code inside file (Look for RewriteBase line)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase / ("this line should be only a slash after RewriteBase - remove anything else")
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

This should solve the problem. - Justin

  • This is the content of .htaccess and it should never be added to wp-config.php. – Milan Petrovic Sep 21 '17 at 7:13
  • You're right. Oversight. Thanks for the tip. Keep up the good work Milan! – Justin Young Sep 22 '17 at 1:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.