Drupal Multisite, MAMP and SVN Best Practices? - drupal

I successfully set-up Drupal Multisites with:
site1.domain.com
site2.domain.com
site3.domain.com
using Virtualhosts and editing the etc/hosts with MAMP on my localhost. I then deployed it using SVN (it deploys automatically) on the live site.
The Problem: when I type "Site1.domain.com" because it goes to my localhost instead of my live site. Is there anyway to avoid this? (apart from renaming the subdomain, because it speeds up deployment)

Just check your virtual host settings in httpd.conf file, are you using IP address to redirect them?
And if its directing to your localhost, just check your host file, if might be redirecting because of that

Related

http://localhost forced into https://localhost when accessing duplicated wordpress site

I am using Duplicator Pro to duplicate a wordpress site from cloudways to my localmachine. After I finished the duplication process, and I enter http://localhost/mysite in the browser, the browser (both Chrome and Safari) change the protocol from "http" to "https", and ofcourse, it can't find the site. Has anyone run into this problem. And it only happens for this particular "mysite" wordpress directory. I have various wordpress folders in my ~/Sites/ folder in my Mac, but I can access all the other wordpress sites locally with http://localhost . But I cannot access this particular "mysite" wordpress directory with just "http". Is there some kind of file that perhaps Apache is looking into that says to redirect http to https when this particular "mysite" is being referenced?
Thanks
Check in the database if site url or home url has https. and try disabling all plugins.

Wordpress on WAMP: Need to change site looking for assets on localhost

I have a wordpress site hosted on WAMP on my local PC. I want other people on my network to view this website but when I tested it from another PC none of the stylesheets, scripts etc are being loaded. I troubleshooted it and found this is because it's looking for those files on localhost. How can I change it to look for those files relative to the folder? Thanks
What you have done is a bit like moving the site to another domain. Because WP records the domain name in its database when you install it, it thinks its domain is localhost.
Now you are getting to it by lets say using your ip address 192.168.0.10 this is considered a new domain name and when it attempts to server various resources it is still using the original domain name of localhost it cannot find those resources on the other PC's.
You can find out what you need to do here on the worpress site Changing the site url
I solved this by using my IP address as the site path in Wordpress/Settings/General

Drupal 7 Multiple sites under subdirectories in server root?

I have a drupal installation in root/httpdocs and want to make a copy of it for development purposes in root/testsite. I have created the folder, copied the website files from httpdocs to testsite and setup a domain pointing to that folder. However, when I visit the page I get "This webpage is not available".
When I try to ping it, I get "unknown host".
Can anyone point to the problem? .htaccess? dns?
You need multiple virtual hosts.
If your using a localhost see: Creating Multiple Virtual Sites on a WAMP Server Installation
Or for a Debian solution see: Hosting multiple websites with Apache2

Redirecting domains in local server with Wordpress installations

I am using Uniserver as local server and have several sub-directories under www that simulate each one a different domain.
Example:
http://localhost/WPTest/ is the WPTest site where there is a Wordpress installation
http://localhost/WPTest1/ is the WPTest1 site where there is another Wordpress installation
What I would like to do and haven't been able, is to redirect http://localhost/WPTest/ just to http://WPTest and http://localhost/WPTest1/ just to http://WPTest1, etc.
I will appreciate any help to do this or at least to tell me if it's possible.
Let Uniserver do the work for you:
Create a Virtual Host opening Server Configuration -> Apache -> Apache Vhosts
Enter the Document Root path (i.e. ./whatever/www/WPTest).
Enter the Server Name (i.e. "wptest"). Use lower case only.
Select Confirm
Restart Apache Server.
Now in Wordpress, go to http://localhost/WPTest/wp-admin.
In Settings -> General, modify:
WordPress Address (URL) and Site Address (URL) replacing the actual URLs with http://wptest
Restart WP.
That's all. Now the virtual Wordpress site is accessed at http://wptest
Repeat the same steps for each subdirectory.

how to name the folders for multisite in drupal locally?

i am creating multisite in drupal 6 in my local xampp server,could anyone help me to name the subfolders?
Have a look at the MultiSite HowTo's at Drupal. There is a massive collection for many different versions and environments. There is also a link to "Multi-Sites Using XAMPP on Windows XP" (can be used for any win versin)
You should name the sites folders the same as you would in production.
example.com
example2.com
....
Then make entries in your hosts file on your computer.
notepad C:\Windows\System32\Drivers\etc\hosts
127.0.0.1 localtest.example.com
127.0.0.1 localtest.example2.com
Then you can build the sites locally using the names localtest.example.com and when you move the site to a production server it will work exactly the same with www.example.com

Resources