I've Broken XAMPP (Routing issue)

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

I've Broken XAMPP (Routing issue)

Postby Spangles101 » 05. May 2015 14:06

Hi All
I've been using XAMPP for a while - I've changed something (possibly a conf file) and broken the routing
I'm an experienced PHP developer - I use various PHP MVC frameworks within XAMPP and all normally works fine - however, I was having trouble with the config on a Zend website recently downloaded and I think I changed a conf file in XAMPP ...

All websites were working fine:
127.0.0.1/website/ will show the home page
127.0.0.1/website/controllername will run a controller in the MVC framework
All was fine

Now, this is what happens:
127.0.0.1/website/ will show the home page
127.0.0.1/website/controllername redirects to 127.0.0.1/xampp and shows the xampp control panel
Any ideas what I changed and how to get it back??
Spangles101
 
Posts: 4
Joined: 05. May 2015 13:57
Operating System: Windows8.1

Zend Website in XAMPP Routing Problems

Postby Spangles101 » 05. May 2015 15:36

I've been given a Zend (1?) website to work on
Other websites with other PHP MVC frameworks work fine - the config on this website is different and I can't get it running
The problem seems to be that Zend is unhappy with the website running in a folder within XAMPP (not a good website)

127.0.0.1/website/ routes to the home page of the website - however, a Zend file (Rewrite.php) throws an exception because /website/ is not a recognised route
If I add a bit of code in Rewrite.php to strip /website/ from the path, the home page displays correctly

We then have another problem ....
Some links on the website point to 127.0.0.1/website/do-something
Other links point to 127.0.0.1/do-something
(The coding of the website is not consistent)

127.0.0.1/website/do-something displays:
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
(at one point I did get some of these URLs working, but not all of them, and I can't remember what I did to get them working - it was probably something in htaccess, but I've changed the config so many times now I've forgotten what I did)

127.0.0/do-something displays:
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

Is there a simple way of routing all requests for 127.0.0.1 into 127.0.0.1/website/ so that Zend accepts the config?
I've been advised to set a vhost in windows like 127.0.0.1 me.websitename.com - this redirects only to 127.0.0.1/xampp/ and shows the xampp control panel

I don't mind changing a conf file in XAMPP so that only this site will work - I can change back if I need to switch to another website - I just need to understand how to fix this config problem
Spangles101
 
Posts: 4
Joined: 05. May 2015 13:57
Operating System: Windows8.1

Re: Zend Website in XAMPP Routing Problems

Postby Nobbie » 05. May 2015 18:14

Spangles101 wrote:just need to understand how to fix this config problem


Simply copy the original config files from a new installation.
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04

Re: I've Broken XAMPP (Routing issue)

Postby Spangles101 » 06. May 2015 09:42

Thanks - they are 2 separate but related issues

I've copied apache/conf from a new installation into the old but still have the same problem in that:
127.0.0.1/website/ will show the home page
127.0.0.1/website/controllername redirects to 127.0.0.1/xampp and shows the xampp control panel
Are there other conf files I should copy across? Is there anything else that I need to check or change?

And once this is sorted out, how do I get the Zend website to run properly?
Spangles101
 
Posts: 4
Joined: 05. May 2015 13:57
Operating System: Windows8.1

Re: I've Broken XAMPP (Routing issue)

Postby JJ_Tagy » 06. May 2015 10:28

Did you accidentally leave the stock index.php in the document root? It has a redirect to xampp admin coded inside.
JJ_Tagy
 
Posts: 678
Joined: 30. January 2012 13:44
Operating System: Windows 10 Pro x64

Re: I've Broken XAMPP (Routing issue)

Postby Spangles101 » 06. May 2015 12:09

Thanks JJ - no, not seen that

I tried coping the apache/conf files from a fresh installation to the old installation - apache failed to run
I removed the old xampp and installed a completely new version - i copied a single website across (CodeIgniter framework) - and more problems
I now get 127.0.0.1/website/ displaying the home page
and
127.0.0.1/website/controllername is redirected to 127.0.0.1/xampp/splash.php

I stopped and restarted apache and then:
I now get 127.0.0.1/website/ displaying the home page
and
127.0.0.1/website/controllername is redirected to 127.0.0.1/xampp/ (the control panel page, not the splash page)

Looking at the apache access log, it shows a 302 response
The entries for the home page are:
[06/May/2015:11:54:41 +0100] "GET /website2/ HTTP/1.1" 200 12638 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0"
127.0.0.1 - - [06/May/2015:11:54:41 +0100] "GET /website2/css/camera.css HTTP/1.1" 200 3979 "http://127.0.0.1/website2/" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0"
[snip dozens of similar lines]

And when I click a link to a different page:
127.0.0.1 - - [06/May/2015:11:54:55 +0100] "GET /website2/img/slider/3.jpg?1430909695462 HTTP/1.1" 200 126737 "http://127.0.0.1/website2/" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0"
127.0.0.1 - - [06/May/2015:11:55:28 +0100] "GET /website2/firstcontroller HTTP/1.1" 302 - "http://127.0.0.1/website2/" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0"
127.0.0.1 - - [06/May/2015:11:55:28 +0100] "GET /xampp/ HTTP/1.1" 200 595 "http://127.0.0.1/website2/" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0"

This website was working fine in XAMPP before I started tinkering with the configs - it has not been changed
This is now a completely fresh installation of XAMPP - so thinking there might be something else in my computer config??????
Spangles101
 
Posts: 4
Joined: 05. May 2015 13:57
Operating System: Windows8.1

Re: I've Broken XAMPP (Routing issue)

Postby Nobbie » 06. May 2015 12:58

Maybe there is a .htaccess in your htdocs folder or in the website2 folder which triggers some redirects?!
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 44 guests