Page 1 of 1

Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 15:20
by jlgoinggreen
Hi,
When I click on my website's link I am being redirected to the XAMPP page. Also if I type http://localhost I am being redirected to the XAMPP page instead of my website's page.

How do I fix this?

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 15:30
by jlgoinggreen
Hi,
I just read where someone on here asked a similar question and was told the question was in the wrong forum. My XAMPP page is coming up when I type localhost, so from what I read I am having a WordPress issue and not an XAMPP issue. I will direct my question to the WordPress forum.

I also just read you guys are volunteers. I'd like to take the time to thank you for your time and helping us out. Your time is appreciated! Thank you!!!

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 15:34
by reaser
Did you ever fix this? I'm having the same thing happen and i"m not using wordpress. My folder is in htdocs and when i type help.mydomain.com it shows the xampp page.

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 15:37
by WilliL
Hi,
in the directory 'http://localhost' (means filefolder 'C:\xampp\htdocs', if you installed XAMPP as recommanded) there is a index.htm which redirects you. Rename it.

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 15:43
by reaser
I did the default install for xampp so i assume that is the recommended. Default install folder c:\xampp and have my files located in c:\xampp\htdocs\helpdesk. Even after completely removed the index.html file I now get index of / and it looks like it is the contents of the c:\xampp\htdocs folder.

I have installed xampp before and had this working just find and for some reason can't seem to figure out the little thing i'm missing to make this work.

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 15:52
by Altrea
WilliL wrote:Hi,
in the directory 'http://localhost' (means filefolder 'C:\xampp\htdocs', if you installed XAMPP as recommanded) there is a index.htm which redirects you. Rename it.

No, the index.php file contains the redirect

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 16:01
by jlgoinggreen
No, I have not been able to correct this issue. I typed my request to WordPress and for some reason someone deleted it. :/

Altrea, if you're not too busy and do not mind, can you help us? I'm assuming you mean the index.php in the XAMPP file. How do I redirect in the index.php? What and where should I type in? I am totally new to all of this.

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 16:01
by reaser
Doesn't matter if you change name of the index.php or index.html. Even with renaming them I think you still need to add the virtual host which is what I was overlooking. I have added the vritual host information to the c:\xampp\apache\conf\extras\httpd-vhosts.conf file. My site is now coming up when I type help.mydomain.com

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 16:06
by reaser
Unless someone else corrects me as being wrong I think this is a 2 step process.
First - rename the index.php and/or index.html. I renamed both as I wasn't sure which one is the actual redirect
Second - navigate to your xampp install folder (mine was default c:\xampp)
Go to \xampp\apache\conf\extras\ and open httpd-vhosts.conf
On the very last line enter the following but change the names to fit your install

<VirtualHost *:80>
ServerName www.yourdomain.com
ServerAlias yourdomain.com
DocumentRoot c:/xampp/htdocs/yourfoldername
</VirtualHost>

I've done this, restarted apache and now can connect by help.mydomain.com

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 16:15
by jlgoinggreen
Thank you reaser, rename the index.php/index.html to what?

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 17:14
by Altrea
jlgoinggreen wrote:Thank you reaser, rename the index.php/index.html to what?

Rename to something else.

reaser wrote:I renamed both as I wasn't sure which one is the actual redirect

Simply take a look at these two files in your code editor and you will see that the HTML file doesn't contain anything that can do a redirect

Re: Web Site Link Redirects me to XAMPP Page. Why?

PostPosted: 13. March 2013 19:12
by JonB
The issue is the order in which Apache processes index files (or default.htm etc). XAMPP has a default order, that is set in httpd.conf.

If you have both a index.php and an index.html file in the same root folder, unless you change the order - the index.php files will always be served first. This only applies when you do not specify the page to be served in teh URL - such as
Code: Select all
 www.mysillydomain.com


Code: Select all
<IfModule dir_module>
    DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
                   default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
                   home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>


IF you are running vhosts, you can make the same changes individually by vhost, or change it in httpd.conf and it is global

http://httpd.apache.org/docs/2.4/mod/mod_dir.html

Good Luck