Wamp running ok, but WordPress site produces 404
Posted by: ErnieFR (---.ip.skylogicnet.com)
Date: January 27, 2017 01:28PM

Hello fellow Wamp-ers :-) I hope you can give me a clue where to look, for solving the following problem, but first here's my technical data as asked for in the forum intro:

1- Windows 7 Home Premium 64bit
2- Version Wamp 3.0.6
3- Apache version 2.4.23
4- PHP version 5.6.25
5- MySQL version 5.7.14
6- WampServer GREEN
7- c:\Windows\System32\etc\hosts
127.0.0.1 Netty
::1 Netty
8- Yes I can go to localhost and see Wamp page
9- Yes I can login to the phpMyAdmin
10- There is no error message
11- Latest version of Avast antivirus and standard Win7 Firewall (both experimentally switched off, no change)
12- C:\wamp64
13- One virtual host 'Netty' which points to basic php copy-site at c:\wamp64\www\netty works fine.

Wamp was easy to install, including all de versions of 32/64bit C++ and ran immediately flawlessly. Opened up the localhost, added MySQL user Wordpress, created database called Wordpress and imported the MySQLdump file I made earlier. Then I copied the whole site (wp-content, wp-includes, wp-admin) underneath c:\wamp64\www\villacathalo
No connection error (so MySQL must be ok), but just the site's home made 404 page appears when accessing localhost/villacathalo.
To check I added another site of mine which runs purely on php called netty and created a virtual host too which both went as intended. No problem on PHP level!

Another small problem is that running villacathalo as virutalhost brings me to the site villacathalo.com itself! So I removed that virtual host, pitty though this needs editing in files in stead of a simple link in Wamp like for creating one.
Also does running localhost/villacathalo/wp-admin/ after logging in, brings me online in stead of staying on the wamp server. But maybe this action is not allowed as there is already a wp-admin under wamp64 too?

I've read all the standard checkouts etc on this forum, but have no clue where to search to solve this problem with the 404 page. Thank you in advance for any ideas, I might not respond immediately cause I'm very busy.

Kind regards from France, Ernie (don't think I'm French, I'm dutch actually so responces in dutch also welcome :-) ).



Edited 1 time(s). Last edit at 01/27/2017 01:34PM by ErnieFR.

Options: ReplyQuote
Re: Wamp running ok, but WordPress site produces 404
Posted by: RiggsFolly (Moderator)
Date: January 27, 2017 02:14PM

Hi

Its not a WAMPServer issue but here is my suggestion.


WP keeps the site url in its database. If you have not ameded all the references to the original sites url i.e. `www.real-domain.com` in the database you restored, it will still attempt to go to that domain when you click a link/menu etc


WP publish a HowTo called Moving a Site to tell you all the things you need to do/check when moving a site

Alternatively do a search for "Wordpress moving a site" and you will find other help/tutorials

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Wamp running ok, but WordPress site produces 404
Posted by: ErnieFR (---.ip.skylogicnet.com)
Date: January 27, 2017 04:43PM

Thank you for your answer and suggestions m. Riggsfolly, I found a usefull search hit at :
[www.wpbeginner.com]
and executed the SQL replacment script which changed a few things to my database;

1 UPDATE wp_options SET option_value = replace(option_value, 'http://www.villacathalo.com', 'http://localhost/villacathalo') WHERE option_name = 'home' OR option_name = 'siteurl';

2 UPDATE wp_posts SET post_content = replace(post_content, 'http://www.villacathalo.com', 'http://localhost/villacathalo');
3 UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.villacathalo.com','http://localhost/villacathalo');

, unfortunately without improvement.
Could it have to do with a home-made (not officially available) theme that is running?

I might redo the whole transfer using the suggested plugin
[wordpress.org]

Hope that will work! Any more suggestions always welcome, have a nice weekend, Ernie.

Options: ReplyQuote
Re: Wamp running ok, but WordPress site produces 404
Posted by: Otomatic (Moderator)
Date: January 27, 2017 06:07PM

Hi,

Read with great attention The need for Virtual Host and you will understand why using 'http://localhost/villacathalo' as url is a very bad way to proceed.

You absolutely must, as at your host, install your local Wordpress in a VirtualHost and then its url will be 'http://villacathalo'

At different hosts like gandi, ovh, 1and1, you will not call your site by:
'http://gandi/villacathalo.com'
or
'http://ovh/villacathalo.com'
or
'http://1and1/villacathalo.com'
well, localhost is the name of your local host and you should not use it in your url.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Wamp running ok, but WordPress site produces 404
Posted by: ErnieFR (---.ip.skylogicnet.com)
Date: January 28, 2017 05:04PM

Thank you very much m. Otomatic, I've been reading all about the vhost config and see some differences with the scripts offered there and the ones made by Wamp itself by using the 'add vhost' option. It creates:
<VirtualHost *:80>
ServerName VillaCathalo
DocumentRoot "c:/wamp64/www/villacathalo"
<Directory "c:/wamp64/www/villacathalo/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

But it does so for both the php-site 'netty' and 'villacathalo' so still does not explain why 'netty' runs without problems and 'villacathalo' sends me either to the live site at villacathalo.com or (when used with the localhost in front of the give url) produces a 404 page not found error.

Kind regards, Ernie

Options: ReplyQuote
Re: Wamp running ok, but WordPress site produces 404
Posted by: Otomatic (Moderator)
Date: January 28, 2017 05:48PM

Hi,

Put here the contents of files:
- 1 - C:\Windows\System32\drivers\etc\hosts
It should be:
127.0.0.1 localhost
::1 localhost

127.0.0.1 netty
::1 netty

127.0.0.1 villacathalo
::1 villacathalo

- 2 - c:\wamp64\bin\apache\apache2.4.23\conf\extra\httpd-vhosts.conf

Do not forget that after modifying the hosts file or the httpd-vhosts.conf file, for the changes to be taken into account by Windows and Apache, you must restart the DNS:
- Right-click Wampmanager icon -> Tools -> Restart DNS

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.