Redirect to XAMP (With hosts?)

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Redirect to XAMP (With hosts?)

Postby cobra-arbok » 13. February 2016 23:19

I wonder whether it is possible to redirect a website to XAMPP folder.

I would like to test a website with XAMPP without changing the URL.
So, by typing in the PC's browser the URL www.yyyyyyy.zz I would like to see the installed website in XAMPP.

I was thinking of changing the hosts file
Code: Select all
127.0.0.1 www.yyyyyy.zz

but I see the dashboard.

Thanks for your suggestions.
cobra-arbok
 
Posts: 3
Joined: 13. February 2016 23:00
Operating System: Windows

Re: Redirect to XAMP (With hosts?)

Postby Altrea » 14. February 2016 00:07

you have done everything correct.
Getting the Dashboard is the expected behavior because the index.php file in htdocs redirects to that Dashboard.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Redirect to XAMP (With hosts?)

Postby cobra-arbok » 15. February 2016 11:30

Altrea wrote:you have done everything correct.
Getting the Dashboard is the expected behavior because the index.php file in htdocs redirects to that Dashboard.


So what should I do?
I should see localhost/appfolder.
If in the hosts file I write
Code: Select all
127.0.0.1/appfolder websiteaddress

It always opens the dashboard

I explain better my problem.

In the original website there is a lot of links pointing to the inside pages.
If they were dynamic (for example, /page/subpage) there would be no problems.
Instead these links point to the same site (www.website/page/subpage).

Now that I've copied the website in XAMPP I can not do the tests because those links lead me to the real external website.
I have to be able to address those links to the site in XAMPP.

Maybe to use hosts is not the right method.
cobra-arbok
 
Posts: 3
Joined: 13. February 2016 23:00
Operating System: Windows

Re: Redirect to XAMP (With hosts?)

Postby Altrea » 15. February 2016 13:19

cobra-arbok wrote:I should see localhost/appfolder.
If in the hosts file I write
Code: Select all
127.0.0.1/appfolder websiteaddress

no. The HOSTS file just do one task: translating a name to an ip. It cannot handle any folders or subfolders or route any of them.

What you should do is use Apache correct. Create 2 virtualhosts, one for localhost and one for websiteaddress. Both needs to have different DocumentRoot settings.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Redirect to XAMP (With hosts?)

Postby cobra-arbok » 15. February 2016 17:21

Ok, Thanks
cobra-arbok
 
Posts: 3
Joined: 13. February 2016 23:00
Operating System: Windows


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 49 guests