I recently bought a script from code canyon that seems to be working fine on live server, but not on WAMP (Apache Version :2.2.22 ), the requirement of the script is that mod-rewrite should be on and it seems to be on
In www folder of wamp my code resides inside folder called jobs
and this is how i am accessing it http://localhost/jobs
But each time it redirects me to http://localhost/jobs/US/
and all i see is WAMP Server Configuration Screen.
On live server this is what .htaccess
looks like
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^careers.clickteck.com
RewriteRule ^(.*)$ http://www.careers.clickteck.com/$1 [R=permanent,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I have not worked with .htaccess
that much so i am not sure what to do to make the script work on localhost, I did try to change RewriteBase
from RewriteBase /
to RewriteBase /jobs
but that did not work either.
I do not see anything inside apache error log
, however I see this code in apache access log
127.0.0.1 - - [25/Jul/2014:22:32:41 +0500] "GET /jobs/ HTTP/1.1" 302 -
127.0.0.1 - - [25/Jul/2014:22:32:42 +0500] "GET /jobs/US/ HTTP/1.1" 200 5924
127.0.0.1 - - [25/Jul/2014:22:32:43 +0500] "GET /jobs/US/index.php?img=pngFolder HTTP/1.1" 200 850
127.0.0.1 - - [25/Jul/2014:22:32:43 +0500] "GET /jobs/US/index.php?img=gifLogo HTTP/1.1" 200 4549
127.0.0.1 - - [25/Jul/2014:22:32:43 +0500] "GET /jobs/US/index.php?img=pngWrench HTTP/1.1" 200 741
127.0.0.1 - - [25/Jul/2014:22:32:43 +0500] "GET /jobs/US/index.php?img=pngPlugin HTTP/1.1" 200 548
127.0.0.1 - - [25/Jul/2014:22:32:43 +0500] "GET /jobs/US/index.php?img=pngFolderGo HTTP/1.1" 200 694
I will really really appreciate if anyone can tell me what am i doing wrong or how to get it to work on localhost.
SOLUTION
I made the following change in .htaccess
which solved the problem
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
---> RewriteRule . jobs/index.php [L] <----
</IfModule>