hide the localhost path name XAMPP - wordpress

Hello There Im Looking For Efficient Way To Hide The Path File In XAMPP LOCALHOST
For Example The Default Path Is [ For Wordpress Files ]
localhost/wordpress
how can i turn it to
localhost only without the /wordpress file path ?
i tired to add a dns localhost to ==>
host file in
C:\Windows\System32\drivers\etc
like
127.0.0.1 testing.com
and added this to the httpd-vhosts.conf
default port is == 80
<VirtualHost *:8010>
DocumentRoot "F:\DEV\htdocs\wordpress"
ServerName testing.com
ServerAlias testing.com
<Directory "F:\DEV\htdocs\wordpress>
Require all granted
</Directory>
</VirtualHost>
when i enter == testing.com [ it's redirecting me to testing.com/dashboard -- testing.com/wordpress
i just need it testing.com
I USE
XAMPP Control Panel V3.2.4
Apache Server
MySQL Database
Wordpress framework == 5.5.1

Please try below code it might help you.
Add this line In host file
127.0.0.1 testing.com
I have just tested this code and it's working
This code in httpd-vhosts.conf
<VirtualHost *:80> ## i have removed 10 from port and it was working in mine
DocumentRoot "D:/xampp/htdocs/wordpress"
ServerName testing.com
ServerAlias testing.com
<Directory "D:/xampp/htdocs/wordpress>
Require all granted
</Directory>
</VirtualHost>

Related

wordpress site working locally but not from the domain

My wordpress site is working locally in my wamp server, this is hosted on an ec2 instance and domain is maintained in Route 53\cloudfare. The domain is working when i checked it using mxtoolbox. The site was working and live till the time i changed my host file in the server. I removed the host file entries accidentally thinking it is a dev site, however i restored it but still the site is not working and i am getting only the "TOO MANY REDIRECTS" error. The following is the current windows host file details
#
127.0.0.1 localhost
::1 localhost
127.0.0.1 mydomain.com
::1 mydomain.com
I restarted the server and WAMP multiple times but it is not working.
The following is my virtualhost configuration
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName mydomain.com
DocumentRoot "c:/wamp/www/sitefolder"
<Directory "c:/wamp/www/sitefolder/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.mydomain.com
DocumentRoot "c:/wamp/www/sitefolder"
<Directory "c:/wamp/www/sitefolder/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require all granted
</Directory>
</VirtualHost>`
Clean your cache and browser history first, then try doing it below:
Open your wordpress admin panel --> Settings--> General --> Make sure it points to the correct domain. --> Save
Or go to the wp-config.php file (Try this if the first method fails / can't be accessed)
add:
define('WP_HOME','http://YourDomain.com');
define('WP_SITEURL','http://YourDomain.com');
or
Try to remove or rename default .htaccess
or
Try to disable the plugin (renaming the plugin folder in the "wp-content/plugin/plugin-folder-name" will non-active that plugin. This might solve the problem if the constraints are due to the plugin)
That's a number of ways when I resolve the ERR_TOO_MANY_REDIRECTS problem. Goodluck

Virtual Host with MAMP

I installed Drupal 8 with MAMP. My MAMP preference number for Apache Port : 80 , Nginx Port: 80 and MySQL Port: 8889
In etc/hosts file, I add 127.0.0.1 mmcast.test
In httpd.conf file,
Listen 80
and uncomment the following line.
# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
In httpd-vhosts.conf file,
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /Applications/MAMP/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerName mmcast.test
DocumentRoot "/Applications/MAMP/htdocs/mmcast"
</VirtualHost>
When I call the site, I type mmcast.test:8888 and also try with mmcast.test:80. However, nothing works! :(
Could someone help me please? I've been trying this problem and still cannot solve.
in httpd.conf file
ServerName localhost:8888
has to be changed to
ServerName localhost:80
For Drupal 8 you need different settings for creating virtual host.
Here is the snippet that needs to be added for virtual host:
<VirtualHost *:8888>
DocumentRoot "/Applications/MAMP/htdocs/site-name/web"
ServerName local.site-name.com
<Directory /Applications/MAMP/htdocs/site-name/web/>
Options Indexes FollowSymLinks
AllowOverride all
RewriteEngine On
RewriteBase /
</Directory>
</VirtualHost>
So I access my local site as
local.site-name.com:8888
I have used default port, which is 8888. So above snippet is according to it.
You can refer this link from Drupal.org as well.

IIS & XAMPP Conflict, Ports Already Changed

I have IIS enabled (fresh "install") and a port configured XAMPP install with a fresh Wordpress build.
httpd.conf (changes):
Listen 8080
ServerName localhost:8080
httpd-ssl.conf (changes):
Listen 4433
<VirtualHost _default_:4433>
ServerName www.example.com:4433
httpd-vhosts.conf (changes):
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:/xampp/htdocs/foobar"
ServerName foo.bar
<Directory "C:/xampp/htdocs/foobar">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
hosts (changes):
127.0.0.1 localhost
127.0.0.1 foo.bar
Tests:
http://localhost/
IIS Root (expected)
http://localhost:8080/[dashboard]
XAMPP Root (expected)
http://localhost:8080/foobar
resolves to http://localhost/foobar, displays IIS error page (incorrect, should show the Wordpress install)
http://foo.bar
displays IIS root (incorrect, should show Wordpress install)
http://foo.bar:8080
resolves to http://foo.bar (same result as above)
Honestly, at this point I have no idea what I have setup that is incorrect. I've spent all day reading forums and SO, and I'm not making any headway. Help? Am I making incorrect assumptions on behavior or do I have a mistake in my setup?
Assuming that you want both services running at the same time, that you'll mostly be working with XAMPP. This is my solution:
I'm not a fan of typing in port 8080 whenever I want to be working with XAMPP. So I just changed the post number of IIS to 82.
Start IIS (7) On the left go to YOUR MACHINE > Sites > Default Web Site
Then on the right click on bindings then a window pops up
Click on the first row and edit the port number to anyting but 80 (because 80 is the default port if you don't type in anything in
your browser)
Reset all the settings of httpd.conf, httpd-ssl.conf
Then open httpd-vhosts.conf and put this:
<VirtualHost *:80>
DocumentRoot C:\xampp\htdocs\foobar
ServerName foo.bar
</VirtualHost>
Restart your computer (httpd-vhosts.conf doesn't take effect without)
The file hosts is fine as it is.

OSX Mavericks Apache Added Virtualhost Loads Localhost instead

Been working on a locahost VHost setup for a WordPress Roots development environment with Bedrock including Composer, Capistrano and WP CLI using Homebrew on my OSX Mavericks Mac Mini all morning. I am using Homebrew's PHP 5.5 and MySQL 5.6.19 and OSX's Apache. Thought I had sort of understood Apache VirtualHost inner workings, but I am missing something.
I added img.local to /etc/hosts
127.0.0.1 localhost img.local
255.255.255.255 broadcasthost
::1 localhost img.local
fe80::1%lo0 localhost img.local
and have this in /etc/apache2/extra/httpd-vhosts.conf:
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerAdmin jasper#img.local
DocumentRoot "/Users/jasperfrumau/webdesign/img/web"
ServerName img.local
ServerAlias www.img.local
ErrorLog "/private/var/log/apache2/img.local-error_log"
CustomLog "/private/var/log/apache2/img.local-access_log" common
<Directory "/Users/jasperfrumau/webdesign/img/web/">
Option FollowSymlinks
AllowOverride All
Order allow, deny
allow from all
</Directory>
</VirtualHost>
I restarted the server using apachectl -k restart as root after I checked the config using apachectl -S . It said I was all good:
apachectl -S
VirtualHost configuration:
Syntax OK
When I load img.local in my browser the root localhost is loaded. So either my img.local is still bypassed because of a faulty vhosts file or there is something else in /etc/apache2/httpd.conf I need to change. What am I missing or doing wrong here?
In the end I realised the /etc/apache2/httpd.conf was loading the vhosts from /private/etc/apache2/other/*.conf so I added one img.conf there and restarted the server. There were some errors in the file after all once it was read. This is the correct one:
<VirtualHost *:80>
ServerAdmin jasper#img.local
DocumentRoot "/Users/jasperfrumau/webdesign/img/web"
ServerName img.local
ServerAlias www.img.local
ErrorLog "/private/var/log/apache2/img.local-error_log"
CustomLog "/private/var/log/apache2/img.local-access_log" common
<Directory "/Users/jasperfrumau/webdesign/img/web/">
Options FollowSymlinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

Setting Up WordPress MS Locally with Port 8888 with XAMPP

I have installed XAMPP and edited the httpd.conf file because my port 80 is busy.
So I have the following:
Listen 0.0.0.0:8888
Servername localhost:8888
Everything works fine until I try to install WordPress 3.0.5 MS because it will not accept ports in the name.
So I have tried to add .htaccess file to my htdocs that contains:
RewriteEngine on
RewriteRule ^:8888/(.*)$ /$1 [L]
But that did not work.
So I have tried to create Virtual Hosts in httpd.conf adding the following at the bottom:
<Directory "C:/xampp/htdocs/www/wp.dev">
Order Deny,Allow
Allow from all
</Directory>
<Directory "C:/xampp/htdocs/">
Order Deny,Allow
Allow from all
</Directory>
NameVirtualHost 127.0.0.1:8888
<VirtualHost 127.0.0.1:8888>
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost2
</VirtualHost>
<VirtualHost 127.0.0.1:8888>
DocumentRoot "C:/xampp/htdocs/www/wp.dev"
ServerName wp.dev
</VirtualHost>
And then I added the following to my hosts file (Help):
127.0.0.1:8888 localhost2
127.0.0.1:8888 wp.dev
And that hasn't worked. I cannot use port 80 as an option, so I need to figure this out. So what am I doing wrong?
Unfortunately WordPress MS requires port 80 to work. You can check the requirements in this link
If using that port in your local machine is not an option for you, what you could consider is to work with a Virtual Machine. (This is the link to the BitNami WordPress virtual appliance in case you want to try it.)

Resources