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:
- Exported MySQL db from offshore server.
- Installed MySQL on local Windows server and restored db.
- Created db user account and password.
- Installed Apache 2.4 on local Windows Server with Php 5.5
- Enabled mod_rewrite in Apache HTTPD.CONF
- Configured PHP.INI for short tag and MySQL extension
- Tested MySQL connection via php in browser - 100%
- Tested phpinfo.php in browser - 100%
- FTP Download entire site from remoteserver.com/htdocs
- Copied FTP saved data to local server c:\apache24\htdocs\
- 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.
- Updated HTTPD.CONF to “AllowOverride All” and also “RewriteEngine On” and “AccessFileName .htaccess”
- Now my links dont 404 - but simply “reloads” current page.
- 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]
- Modified RewriteCond %{HTTP_HOST} ^hst.org.za$ [NC] - then i get “page redirecting in a way that will never complete”
- 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
- Played with localhost, public ip, local ip, port 80/8080 for the listening. No change, error persist.
- 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