how to get wamp subfolders to act as the root so I can use relative paths on local server for it to work on live server without modifications?
Posted by: mafgirl (78.147.164.---)
Date: July 04, 2011 02:38PM

how can i get wamp subfolders to act as the individual roots so I can use relative paths on local server for it to work on live server without modifications?

I have successfully installed several local sites and successfully transferred them to a live site. However, on the local sites i cannot use relative paths, it will give me an error.
for instance, I have a subfolder foo, on one of the pages I refer to a particular part of a page within my own website and link to it using the relative part: /what/#cms instead of the full part which would be [localhost] and on the live site [foo.com]
However, when using the relative path, wamp is trying to go to [localhost] treating localhost as the root instead, and of course this page does not exist in localhost but in the subfolder foo.
Can anything to be done about this?
I am currently running about 5 local sites that i sync with the live sites and it is a lot of work to constantly have to change all the paths within the websites..

Thanks everyone!

Marjolijn

[www.mafgirl.com]



Edited 1 time(s). Last edit at 01/19/2012 05:42PM by mafgirl.

Options: ReplyQuote
Re: how to get wamp subfolders to act as the root so I can use relative paths on local server for it to work on live server without modifications?
Posted by: stevenmartin99 (---.sites.bitbuzz.net)
Date: July 04, 2011 03:45PM

Didn't I helP you set up vhosts?

This will make the folder you choose as a doc root for that site

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

Options: ReplyQuote
Re: how to get wamp subfolders to act as the root so I can use relative paths on local server for it to work on live server without modifications?
Posted by: mafgirl (78.147.164.---)
Date: July 04, 2011 03:53PM

oh does it? yes you did help me set it up, but i didn't realize it was for the purpose of the folder being the root, I thought it was just to get the multi site working.
As my other sites were working already so I didn't bother changing the settings for them as i didnt want to mess it up..
But as I am now syncing them I realize the root problem..
So what you are saying is that all I have to do is follow your instructions for the other existing (and new) sites? which is this for wordpress sites:

• in wp-config file:
o define('WP_HOME', 'http://yourlocalsitename.loc' );
o define('WP_SITEURL', 'http://yourlocalsitename.loc');
o define( 'DOMAIN_CURRENT_SITE', 'yourlocalsitename.loc' );
• database settings:
o table = wp_options:
option_id 1 siteurl to yourlocalsitename.loc
option_id 37 home to yourlocalsitename.loc
o table = wp_blog:
column - domain = change all urls to yourlocalsitename.loc
o table= wp_site:
change url to yourlocalsitename.loc
• C:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf:
o <VirtualHost *:80>
ServerName yourlocalsitename.loc
ServerAlias yourlocalsitename.loc
DocumentRoot "C:/wamp/www/yourlocalsitename"
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
create folder c:/wamp/www/yourdomain/logs
C:\windows\system32\drivers\etc\hosts :
o add entry: 127.0.0.1 yourlocalsitename.loc
o restart WAMP

Options: ReplyQuote
Re: how to get wamp subfolders to act as the root so I can use relative paths on local server for it to work on live server without modifications?
Posted by: stevenmartin99 (---.sites.bitbuzz.net)
Date: July 04, 2011 03:58PM

Yea if it's not a wordpress site just add the code to the vhosts file
And add a line to the hosts file


I can help you in an hour or two if you want.

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

Options: ReplyQuote
Re: how to get wamp subfolders to act as the root so I can use relative paths on local server for it to work on live server without modifications?
Posted by: mafgirl (78.147.147.---)
Date: July 07, 2011 10:44AM

Hi Steven,

Thank for your offer to help, I've managed to do it, all sites are now working on yoursitename.loc
BUT the only thing that doesn't work is the 'Your Projects' links on WAMP Server Home Page do not link to the .loc but the 'old' link. The one you set up for me originally goes to the 'old' link but re-directs somehow to the new .loc so I must have missed something.
I followed ALL the steps I mentioned above, plus created new .htaccess for each site.
Anything missed?

[www.mafgirl.com]

Options: ReplyQuote
Re: how to get wamp subfolders to act as the root so I can use relative paths on local server for it to work on live server without modifications?
Posted by: stevenmartin99 (---.251.255.12.threembb.ie)
Date: July 07, 2011 12:15PM

Do u have the sites in the c:/wamp/www ?

If u put the newer sites somewhere else then it won't pic them up.

Maybe I can show u how to get it to work if that's the issue

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

Options: ReplyQuote
Re: how to get wamp subfolders to act as the root so I can use relative paths on local server for it to work on live server without modifications?
Posted by: mafgirl (---.london.02.net)
Date: July 07, 2011 01:10PM

Hi Steven,

Yes the sites are still in c:/wamp/www/theirownfolder
would be great if you could have a look although im working til late tonight. tomorrow have time until 4pm or else Monday all day/eve? I can't think of anything i may have forgotten, I've double checked everything. Luckily the sites themselves do work and it's only the 'my projects' link that isn't

thanks Steven, let me know when you have time

Marjolijn

[www.mafgirl.com]

Options: ReplyQuote
Re: how to get wamp subfolders to act as the root so I can use relative paths on local server for it to work on live server without modifications?
Posted by: stevenmartin99 (---.251.255.13.threembb.ie)
Date: July 07, 2011 03:45PM

Any time saturday or Sunday

Anytime weeks days after 5 pm

Just email me in these times and should be fine smiling smiley

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.