first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..[RESOLVED]
Posted by: mafgirl (209.59.96.---)
Date: June 05, 2011 05:24PM

Hello everyone,

I have recently started using WAMP to see if I can get along with it and update my blog from a local environment instead of live, which would be a lot easier for me, especially considering I do a lot of flying for work, which currently eats into valuable time for updating my blog or updating clients' websites.

I use wordpress for my blog and all other sites and found a good guide on their codex ( [codex.wordpress.org] ), that linked to this guide I used for the setup: ( [weblogtoolscollection.com] )
Essentially, I follwed these steps to get my first website (blog) working:
• turn off skype (as it uses post 80),
• install wamp, not changing default settings,
• launch wamp.
• click wamp in taskbar, go to php and click php.ini.
• change upload_max_filesize and post_max_size to 1000, save file and restart computer.
• copy back up of public_html in the www folder (in my case it was C:/wamp/www/blog)
• create database in localhost/phpmyadmin with the same name as database in public wordpress site (found in wp-config.php).
• select database, import the back up .sql file.
• in wp_options table find siteurl (page1) and home (page 2) change url to [localhost] and click go.
• create new user with same name and password as wp-config.php & ADD user to correct database after creation.
• switch on apache rewrite_module and restart, delete .htaccess and go to your localhost/blog/wp-admin Wordpress dashboard. change permalink settings to default and change back to what you had (to create new .htaccess file, because just enabling rewrite did not create a new .htaccess for me, this did ).
• Done.

This worked like a dream, I can access/navigate and edit my blog locally.

Then I added the second site, which is a Wordpres Multisite, I followed the same tutorial and changed the same settings in it's own corresponding database and wp-config.
This site is located in C:/wamp/www/driverszone. on going to localhost, I clicked driverszone under Projects, which it's alt tag correctly displayed: localhost/driverszone , yet re-directed to [www.driverszone.co.uk]. this was at the point where I had deleted the .htaccess file and wanted to log into the wordpress dashboard by going to localhost/driverszone/wp-admin and change the permalink structure.
I did some more research and have since tried these possible solutions to no avail:
• put the old .htaccess back in
• deleted old .htaccess again and copied in my blog's htaccess - changing the url in the file to /driverszone instead of /blog
• found this guide [www.infinitedesigns.org] and followed it's instructions
• added this in my hosts file:
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
127.0.0.1 blog
127.0.0.1 driverszone
•uncommented Include conf/extra/httpd-vhosts.conf in C:\wamp\bin\apache\Apache2.2.17\conf
• browsed to C:\wamp\bin\apache\Apache2.2.17\conf\extras\httpd-vhosts.conf deleted the examples and added in:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.mafgirl.com
ServerAlias mafgirl.com
DocumentRoot C:/wamp/www/blog
ErrorLog "C:/wamp/www/blog/logs/error.log"
CustomLog "C:/wamp/www/blog/logs/access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerName www.driverszone.co.uk
ServerAlias driverszone.co.uk
DocumentRoot C:/wamp/www/driverszone
ErrorLog "C:/wamp/www/driverszone/logs/error.log"
CustomLog "C:/wamp/www/driverszone/logs/access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>

- I did also try to add <directory>, but no change and as this tutorial was telling me that if my files were located in the wamp/www folder I could omit the <directory> parts, I omitted it.
• restarted apache - when the driverszone Projects link was still redirecting to www.driverszone.co.uk, I restarted the computer
• still the same, so I deleted the whole driverszone directory and started again, but no change
• looking back to the first guide's comments and suggestions of other users, I also tried adding this to my wp-config.php
define(‘WP_HOME’, ‘localhost’ );
define(‘WP_SITEURL’, ‘localhost’);
and when that didnt work
define(‘WP_HOME’, ‘[localhost]‘ );
define(‘WP_SITEURL’, ‘[localhost]‘);
• Googled the problem, and read countless of forums, including many topics on this forum, but could not find anything I had not tried yet, although I could be using the wrong keywords


All the while, my first site is still working and my second is still redirecting to the public URL. I am using WAMP server 2.1 on a Windows 7 6bit machine.. has anyone got any idea where I am going wrong?

Thanks ever so much for your help smiling smiley

[www.mafgirl.com]



Edited 1 time(s). Last edit at 06/07/2011 08:14PM by mafgirl.

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: June 05, 2011 05:33PM

wow you have tried alot of things smiling smiley

i cant really help you with out since you have tried all of the standard things to check , but if i could take a look at it myself.. using teamviewer or similar to help you out

i would just remind you to make 100% sure you change all references of the domain in the database...

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: mafgirl (209.59.96.---)
Date: June 05, 2011 05:42PM

I wanted to make sure I tried everything, before I started bugging people smiling smiley
What would you need from me to enable you to look at it with teamviewer?
I don't know where else the domain would be referenced, apart from siteurl and home in the database...

Thanks for wanting to help smiling smiley

[www.mafgirl.com]

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: June 05, 2011 05:46PM

you need to download teamviewer from www.teamviewer.com and pm me or mail (gmail below) the id and pin

Usually there is 2-3 references of the domain in the database

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: mafgirl (209.59.101.---)
Date: June 06, 2011 02:57AM

Hi Steven,

Thanks again for all your help via teanviewer. I will look into it a little more in the morning, but there do seem to be some issues with installing a wordpress multisite on WAMP and it is not as straightforward. I've read in some forums already about the localhost.localdomain instead of localhost/localdomain, so you were on the right track, changing that!
Whilst I was at work, I managed to install a third site on WAMP (the corrigan-centley that you saw empty in my wamp's www), this is a single wordpress site and works perfectly!
So it is def an issue with it being a multisite install...
I will read up about it and write here if I manage to find a solution!

thanks again for all your help

[www.mafgirl.com]

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: yfastud (Moderator)
Date: June 06, 2011 03:04AM

Actually, you can put those sites aside and following these tips instead those guides:

1. Setup Database account, 1 for each WP site

To setup Database Account, follow this
[blog.jlbn.net]

2. Setup VH, 1 for each WP site

No matter within or outside LAN access, you need to setup Access, DNS, and VH; Access for permission to connect to your Wamp PC, DNS to tie Domain(s) to your Wamp PC, and VH to host multiple Domains/Websites/IP's and even you have only 1 Domain/IP, you should use VH to set it up w/ the site you want to show up first on top and localhost on bottom and others in middle if having more than 1 site; w/ VH, other PC's, no matter w/i or outside LAN, can access/see websites/contents on your wamp PC. If dont have real Domain, just skip DNS guide

To setup Access, follow this
[blog.jlbn.net]

To setup VH, follow this
[blog.jlbn.net]

To setup DNS, follow this
[blog.jlbn.net]

3. After setup VH, you should have couple local domains such as 'http://wordpress1', 'http://wordpress2'... then use local domain to setup WP first, after that use Moving WP guide to copy your WP from host to local

To setup Wordpress on Wamp, follow this
[blog.jlbn.net]

To move Wordpress on Wamp, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: June 06, 2011 07:57AM

Hi. Can you try something that I nelver thought to try

Add a file into the folder

Any name and any code

See if that file loads or you get redirected

Using. [driverszone.loc]

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: mafgirl (209.59.96.---)
Date: June 06, 2011 12:35PM

Thank you yfastud, I'll read up on your guides and see if it fixes the problem!

Steven, I tried what you said and it does not get redirected. get a bunch of errors because it is a php i copied from a different website, but it displays [driverszone.loc] in the bar and not driverszone.co.uk!
Going to have a good try with yfastud's guides and read up about wordpress multisite on wamp today.
If you wanted to have another look with teamviewer, i will be around most of the day today

[www.mafgirl.com]

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: June 06, 2011 12:51PM

well if its not being redirected then not .htaccess

and since there is no .co.uk values in the db (other than a few images) it must be a redirection in a file


yes i can take a look if you like - im off today

just email me your details

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: yfastud (Moderator)
Date: June 06, 2011 11:33PM

Wordpress use permanent URL so if you copy from host, it will redirect back to host; thus, you have to follow my "Moving Wordpress" guide to copy it to your local winking smiley

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: mafgirl (209.59.96.---)
Date: June 07, 2011 12:00AM

@yfastud, thanks, I had a read of your guide and will try it. i do wonder though, i did not use this guide for my other two wordpress sites and they work fine and still think it has something to do with my non working wordpress site being a MPWU site..

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: yfastud (Moderator)
Date: June 07, 2011 01:41AM

With older MPWU, you can set it up on local but might be not w/ later version, so you have to setup a fake local domain like a real domain; for example, localhost.com and from there to have subs like sub1.localhost.com, sub2.localhost.com...

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: mafgirl (89.243.12.---)
Date: June 07, 2011 06:40PM

stevenmartin99 had a another look at my setup with teamviewer and made it work!

Still using the set-up I described above in my first post, with the imported database of the live site, he changed this:

wp-config file:
---------------

define('WP_HOME', 'http://driverszone.loc' );
define('WP_SITEURL', 'http://driverszone.loc');


define( 'DOMAIN_CURRENT_SITE', 'driverszone.loc' );


-----------------------------------------------
-----------------------------------------------

database settings:
---------------



table = wp_options:
----------------
option_id 1 siteurl to driverszone.loc
option_is 37 home to driverszone.loc


table = wp_blog:
----------------
column - domain = change all urls to driverszone.loc


table= wp_site:
----------------
change url to driverszone.loc

-------------------------------------
--------------------------------------

C:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf:
---------------------------------------------------------------

## TO ADD A NEW SITE COPY A <VHOST> SECTION BELOW AND CHANGE THE URLS AND PATH TO POINT
## TO THE SITE. MAKE SURE YOU ALSO CREATE THE LOGS FOLDER AS APACHE DOES NOT DO THIS.
## THEN OPEN C:\windows\system32\drivers\etc\hosts and add an entry
## 127.0.0.1 url
## SAVE AND RESTART WAMP FOR THE NEW URL TO WORK.

<VirtualHost *:80>
ServerName driverszone.loc
ServerAlias driverszone.loc
DocumentRoot "C:/wamp/www/driverszone"
</VirtualHost>


<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>

to get to my localhost wordpress MU site I just type in: [driverszone.loc]

smiling smiley Hope this will help others set up Wordpress MU on a locahost

PS how do I change this topic to resolved?

[www.mafgirl.com]



Edited 1 time(s). Last edit at 06/07/2011 06:42PM by mafgirl.

Options: ReplyQuote
Re: first local Wordpress site running perfect on WAMP, but following the same instructions for second site makes it redirect to public URL..
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: June 07, 2011 06:46PM

edit your subject in the first post - just add [RESOLVED] to the end of it

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.