1

So I’ve just migrated a magento store over to a new server.

Gone through the standard setup procedure of copying the html files, updating the host url in the database and modifying my db details in app/etc/env.php.

I’ve also disabled the dev static signing option to prevent the issue where magento looks for assets in pub/static/versionxxxx..

The issue I’m having now is that my index.php loads fine and all looks how it should.

However clicking any link, for example a href to /scarves.php gives me a 404. Not quite sure why as obviously all of my pub and php files are not in the index folder.

How can I go about fixing this, does magento rewrite these links internally somehow?

5
  • try to run the magento re indexing again on the server.
    – nishu
    Commented Jun 18, 2019 at 6:49
  • I’ve ran reindexing quite a few times. I’m new to magento but how is it supposed to work when you click a link. Because all of these php pages are not under /<path> and Apache is throwing a 404 because of this.
    – Adam
    Commented Jun 18, 2019 at 6:51
  • sudo a2enmod rewrite Commented Jun 18, 2019 at 6:52
  • I’ve also turned on Rewrite mode for apache, can you provide some insight into how the expected behaviour should work for rewriting the links?
    – Adam
    Commented Jun 18, 2019 at 6:55
  • @Adam, No need to do any. Just take fresh .htaccess file and upload. Take backup first Commented Jun 18, 2019 at 7:10

1 Answer 1

0

Even i faced this problem you need to add these lines in your htaccess file.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
1
  • Will that not have a similar issue, if for example I navigate to “products.php” then that rule would rewrite the path to “index.php/products.php” which apache wouldn’t be able to recognise as its not a valid file path. So how would that end up working?
    – Adam
    Commented Jun 18, 2019 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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