I have made a fully operating WP site locally on my computer(whit xampp and localhost). I wanted to add whit site to a live domain using the xampps vhosts.conf file. For the 1st time the site's main page loaded perfectly but after that no other part of the site will load, not even the style sheet.
Any suggestions what to do?
Thanks
This is what i have added to the vhost file:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.example<br>
DocumentRoot "C:/xampp/htdocs/WP"<br>
ServerName /*Actual server name*/
</VirtualHost>
You have to change the path of home and siteurl in 'wp-options' table in your database.
you can take further help from wordpress site https://codex.wordpress.org/Moving_WordPress
Related
I uploaded the laravel project on the live server. When I try the url with :
www.abcd.com.au/admin/dashboard
then it shows me a messed up site and also shows some contents that were downloaded from bootstrap template website .
And when I try this url:
www.abcd.com.au/project/public/admin/dashboard
then it shows me the correct website and neatly as the way website was designed on the localhost xampp and on the live server.
I wanted to have the url as: /admin/dashboard and not project/public/admin/dashboard
How can i set up this on the live server please?
Thanks.
It sounds like your URL is pointed to the wrong folder. In Laravel the URL must point to the project's public folder.
open your VirtualHost on your server .conf file and update DocumentRoot and try
<VirtualHost *:80>
DocumentRoot "/Path your project/project/public"
ServerName www.abcd.com.au
<Directory "/Path your project/project/public">
Options All
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
i am pretty new this kind of work. I had developed a web app using PHP. i am using XAMPP Server. Now when i am hitting http://www.mywebsite.com/myproject i got my project index page. Now what i looking is if i enter http://www.mywebsite.com it should display myproject's index page.
I am not sure what is this term called. I didn't know how to search for this solution.
Your help will be much appreciated if you can provide the term i should look for or the solution for this.
thanks
When you edit the httpd-vhosts.conf file (which is in C:\xampp\apache\conf\extra), edit the DocumentRoot property accordingly.
Your current settings are probably looking like this:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName www.mywebsite.com
</VirtualHost>
which directs you to the main htdocs folder. In order to display your project, you use www.mywebsite.com/myproject. You should change the DocumentRoot. For example:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/your-project-folder"
ServerName www.mywebsite.com
</VirtualHost>
Tested on Win 8.1 Pro x64, XAMPP 5.6.21 portable. It's working.
Open the file index.php from the htdocs in xammp ( ..\xampp\htdocs\index.php)
Change the line
header('Location: '.$uri.'/dashboard/');
to
header('Location: '.$uri.'/yoursitefolder/');
this will resolve the issue.
We have hosted multiple PHP websites in different domains in same server. Each domain have it own folder under /var/www/html. For e.g.
example1.com is pointing to /var/www/html/example1.com
example2.com is pointing to /var/www/html/example2.com
example3.com is pointing to /var/www/html/example3.com
etc..
Since Saturday, when I browse example1.com or example2.com or example3.com, it is showing same content in browser. That means every time I browse it is showing website content from /var/www/html/example3.com folder. I'm not sure how this change happened. May be one of our ex-employees changed this.
So I checked httpd.conf file in /etc/httpd/conf. Here documentroot is set correctly for all the domains. As I'm new to web administration, I'm not sure where exactly I've to correct to make all websites point to right folder.
What exactly is this problem? How will I rectify this?
Do I need to correct this in http.conf file or .htaccess file in every domain folders?
I'm struggling since yesterday. Any help is really appreciated.
Thanks in advance..
Finally I'm able to resolve the issue. I have about four websites with different domains running in this server. For couple of websites, under VirtualHost tag, DocumentRoot and ServerName were missing. After I added those values and restarted the apache server, it started working.
The incorrect entry was looking like this:
<VirtualHost *:80>
ServerAdmin demo#demo.com
ServerAlias www.example1.com
</VirtualHost>
I changed that as mentioned below:
<VirtualHost *:80>
ServerAdmin demo#demo.com
ServerName example1.com
ServerAlias www.example1.com
DocumentRoot /var/www/html/example1.com/
</VirtualHost>
Thank you all for the help.
I have set up a local wordpress environment which is a carbon copy of a live site so we can work on a new design.
The live site database has been copied into localhost php myadmin and is working fine.
The localhost site is situated in a folder called /3dfc/ inside the htdocs folder.
So i have a site address of - http://localhost:8888/3dfc -
I can view the whole website no issues, apart from the homepage.
Any ideas on how to fix?
goto wp-admin
setting --> reading
and set your front page to the page which you want to set as home page.
I found the solution. I post a similar question here:
Home Page Wordpress on Free MAMP does not work
after several debug I found that this guide is correct:
http://foundationphp.com/tutorials/vhosts_mamp.php
You need:
1. In /etc/hosts add your virtual hosts like:
127.0.0.1 localhost
127.0.0.1 mywebsite
before I only used localhost because I hoped to use this host in browser but I found it's required to define a new host like mywebsite.
In httpd.conf I activated:
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
In this file I have:
NameVirtualHost *:8888
ServerAdmin myuser#gmail.com
DocumentRoot "/Applications/MAMP/htdocs"
ServerName mywebsite
ErrorLog "logs/mywebsite-error_log"
CustomLog "logs/mywebsite-access_log" common
I am currently working on a wordpress multisite project. I have set up a working environment in localhost. In the main menu there is a links to home, so is in subdirectory sites. Now my problem is everything works find in testing server environments as the main site URL is myhost/xx/wordpress_site and sub directory sites are like myhost/xx/wordpress_site/sub_dir. In wordpress Appearance->menu you can only give a static url in the link URL field. What I am looking for is to give a method like site_url().”/sub_dir” in that field so I don’t have to manually alter all the site home URLs when I upload the site to it’s destination domain. Which can be any form?
Any simple solution regarding this problem its greatly appreciated.
Thanks a lot.
I would not recommend to change anything on wordpress code or site url configuration.
because when you will go to production you will have to change it back again.
It will be the best if you will setup the same site configuration on your localhost, you can use the following configuration for your apache server and host file so you will be able to
access your local site by your actual domain.
This way your settings will remain the same and all site links will be the same.
(rename mysite to your site url)
how to change host file:
http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/
how to add virtual host apache:
http://httpd.apache.org/docs/current/vhosts/examples.html
Apache configuration:
<VirtualHost mysite.com:80>
ServerName mysite.com
DocumentRoot /var/www/mysite
<Directory /var/www/mysite>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
host file configuration:
127.0.0.1 mysite.com
restart apache and you will be able to work on localhost like it is the productin server.
* Remove the following when you want to access the real server.