Please help with Windows PHP instance

Background: i was tasked to move our current linux apache php website from a hosted server and migrate it to a Windows server. what i have done is:

  1. Exported MySQL db from offshore server.
  2. Installed MySQL on local Windows server and restored db.
  3. Created db user account and password.
  4. Installed Apache 2.4 on local Windows Server with Php 5.5
  5. Enabled mod_rewrite in Apache HTTPD.CONF
  6. Configured PHP.INI for short tag and MySQL extension
  7. Tested MySQL connection via php in browser - 100%
  8. Tested phpinfo.php in browser - 100%
  9. FTP Download entire site from remoteserver.com/htdocs
  10. Copied FTP saved data to local server c:\apache24\htdocs\
  11. Home page localhost/index.php opens 100%

Problem: All the menu links point to servername/generic/4 for example or servername/healthstats/23/data, but clicking on these links gave me a 404 page cannot be found.

  1. Updated HTTPD.CONF to “AllowOverride All” and also “RewriteEngine On” and “AccessFileName .htaccess”
  2. Now my links dont 404 - but simply “reloads” current page.
  3. Looked at .HTACCESS and found these rules:

RewriteCond %{HTTP_HOST} ^hst.org.za$ [NC]
RewriteRule ^(.)$ http://www.hst.org.za/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.
)$ index.php?q=$1 [L,QSA]

  1. Modified RewriteCond %{HTTP_HOST} ^hst.org.za$ [NC] - then i get “page redirecting in a way that will never complete”
  2. Modified RewriteRule ^(.)$ http://209.203.2.250/index.php/$1 [L,R=301] to RewriteRule ^(.)$ http://209/$1 [L,R=301] - No change, error persist
  3. Played with localhost, public ip, local ip, port 80/8080 for the listening. No change, error persist.
  4. Loaded site into IIS 7.0, enabled FastCGI and started site. No change, error persist.

I dont know what else to check…

Working Site: http://indicators.hst.org.za/index.php
Copy of Site: http://209.203.2.250/index.php

Left hand link on current site: http://indicators.hst.org.za/generic/1 <— works perfectly
Left hand link on copied site: http://209.203.2.250/generic/1 <— here lies the issue

Why in the world would anyone go from Linux to Windows?

Ooooh, not jumping into the Linux vs Windows mess… LOL

So, seldom do you need to rewrite your site entries using your HTACCESS when you move to a new server.
Unless you hard-coded links to your old server’s URL’s. You said all of your links were coded to a set URL
location. Was this done using the server’s GLOBAL URL addresses or was it actually hand written into the
link codes? If it is www.me.com and the link is then,
you have to change them all. If it was done using GLOBAL’s, it should all work.

Another issue might be folder structure. When you recreated the old server’s files, did you set up all of the
folders and make sure the permissions were accurate?

Last thought is the rewrite’s you might have on the old system. Was there anything odd in that code?

Not sure if any of this helps, just attempting to think it out…

Sponsor our Newsletter | Privacy Policy | Terms of Service