I transfer my Live site to localhost and changed the URL in core_config_data table.Setting the database connection in local.xml file

My website home page is running well in localhost but when I click any link on home page it redirects to localhost dashboard.

here is my .htaccess file code

DirectoryIndex index.php
<IfModule mod_php5.c>
## enable rewrites
    Options +FollowSymLinks
    RewriteEngine on
## you can put here your magento root folder
## path relative to web root
    RewriteBase /
    #RewriteRule ^(.*)\/(\?.*)?$ $1$2 [R=301,L]
## rewrite API2 calls to api.php (by now it is REST only)
    RewriteRule ^api/rest api.php?type=rest [QSA,L]
## workaround for HTTP authorization
## in CGI environment
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
## rewrite everything else to index.php

    RewriteRule .* index.php [L]
RewriteRule ^products/(.*)$ /$1 [L,R=301]

RewriteRule ^(.*)/products/(.*).html$ http://%{SERVER_NAME}/$1/$2.html [NC,R=301,L]

Please help me to find the solution

  • remove var/cache folder Nov 23 '16 at 7:55
  • @Fme Extensions I already did but not working
    – xr33dx
    Nov 23 '16 at 7:59
  • is anyone there please help me to find the solution
    – xr33dx
    Nov 23 '16 at 9:35

You need to follow these step first and check

  1. Remove your var/cache folder.

  2. Fulsh all cache from admin.

  3. Reindex all from index management

To reindex via command line

1 – Go to ‘shell’ folder in your Magento installation:

cd shell

2 – Execute reindex using this command:

php -f indexer.php reindexall
  • When I doing your step 1 and 2 are done but in 3 step it showing error. An error occurred while saving the URL rewrite
    – xr33dx
    Nov 23 '16 at 8:17
  • hey @Ashish are you there??
    – xr33dx
    Nov 23 '16 at 8:24
  • @xr33dx, You need to reindex via command line. Pl check my updated answer Nov 23 '16 at 8:25
  • I am new on magento and I dont know how to do it by command line
    – xr33dx
    Nov 23 '16 at 8:28
  • @xr33dx its not magento. Just open your terminal and use cd command to change the directory and type your project root folder path of your system starting with / Nov 23 '16 at 8:31

there is a problem in my server .htaccess file,I replaced my server .htaccess file to Magento default .htaccess file and it works.

Thanx to all who try to help me


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.