Page 1 of 1

Issue with mod_rewrite after moving to new machine

PostPosted: 18. April 2017 21:28
by MargateSteve
I have installed XAMPP on a laptop and cloned a couple of my projects so I can work on them on the train to work. Both are accessed using alias and while the most basic one (a simple template) works fine, the more complicated one is giving me

Bad Request
Your browser sent a request that this server could not understand.
Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.


This project is a multi-site MVC project and relies on friendly urls in htaccess, which is what I believe is causing the problem. The only difference between my main PC and the laptop is that on the PC it is installed in a partitioned drive W:/, while on the laptop it is in C:/. I also copied the httpd-vhosts file from the PC and just changed W:/ to C:/.

The working project is
C:/xampp/htdocs/PersonalProjects/adminTemplate on the laptop
W:/xampp/htdocs/PersonalProjects/adminTemplate on the PC
http://adminTemplate as the alias on both

The non-working one is
C:/xampp/htdocs/PersonalProjects/FootballDB/footballdb_playground on the laptop
W:/xampp/htdocs/PersonalProjects/FootballDB/footballdb_playground on the PC
http://FootballDB_Playground as the alias on both

As I said, there are no issues with the first one so that rules out anything wrong with the hosts set-up.

I have checked on the PC and the non-working one still works there so it is not something I broke and forgot about before copying.

I thought it might be a MySQL problem but when I access it directly via http://localhost/personalprojects/footballDB/footballdb_playground/, it connects to the database fine.

This leaves me to think it can only be something to do with the mod_rewrite settings in XAMPP that I need to change. I have checked it is un-commented in httpd.conf and changed AllowOverride None to AllowOverride All wherever I found it as per instructions found online. I have also uninstalled, re-installed with admin rights and run with admin rights to no avail.

As I recall, when I first started the project on the PC, I did not need to change anything and it worked straight off. However, that was a year ago so there might have been something to do but if so, it cannot have been much otherwise I would have remembered it being a pain.

The error log does not give any info as far as I can see. The only things that stand out there are the warning about www.example.com:443:0, but that just refers to a default value in httpd-ssl AND is the same on my PC anyway, and a core warning of an unclean shutdown process but this appears not matter how I shut down Apache or XAMPP.

Code: Select all
[Tue Apr 18 21:27:51.886363 2017] [ssl:warn] [pid 14308:tid 656] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 18 21:27:52.111576 2017] [core:warn] [pid 14308:tid 656] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Tue Apr 18 21:27:52.315645 2017] [ssl:warn] [pid 14308:tid 656] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 18 21:27:52.384171 2017] [mpm_winnt:notice] [pid 14308:tid 656] AH00455: Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 configured -- resuming normal operations
[Tue Apr 18 21:27:52.384171 2017] [mpm_winnt:notice] [pid 14308:tid 656] AH00456: Apache Lounge VC11 Server built: Dec 20 2016 13:02:04
[Tue Apr 18 21:27:52.384171 2017] [core:notice] [pid 14308:tid 656] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Tue Apr 18 21:27:52.394156 2017] [mpm_winnt:notice] [pid 14308:tid 656] AH00418: Parent: Created child process 7764
[Tue Apr 18 21:27:53.593569 2017] [ssl:warn] [pid 7764:tid 660] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 18 21:27:54.097739 2017] [ssl:warn] [pid 7764:tid 660] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Tue Apr 18 21:27:54.175258 2017] [mpm_winnt:notice] [pid 7764:tid 660] AH00354: Child: Starting 150 worker threads.


Quite simply, have I missed something that I needed to change/set? The files are exactly the same on both machines so really cannot fathom out why it works on one and not the other.

Thanks in advance
Steve