0

I have just begun working with ExpressionEngine. The production site is working just fine and I wanted to create a local version for dev purposes.

I am receiving 404 not found errors on my localhost pages such as localhost:8888/example.com/products or localhost:8888/example.com/aboutus, but the index or home page comes up just fine - localhost:8888/example.com/

I have followed the steps for migration from this link - http://ellislab.com/expressionengine/user-guide/operations/moving.html

1) Downloaded flat files via ftp 2) Used a backup .sql to load the local mysql 3) Able to login to system - localhost:8888/dev.example.com/system - all usernames & passwords work 4) Setup all the URLs within Admin> General Configuration - so on and so forth

I was able to fix my template synch issue by going into the Design> Templates> Global Preferences and change the path to the templates' path on my computer - they were still set to the template’s path in production.

/Applications/MAMP/htdocs/dev.example.com/templates

Both the localhost:8888/example.com/system and the initial index page - localhost:8888/example.com/ - function exactly as they would be expected to do.

I have created an htaccess file and placed it within /Applications/MAMP/htdocs/dev.example.com/:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

But I am still receiving a 404 not found error whenever I try to go to localhost:8888/example.com/products then it thinks that /index.php/products was not found, why does it not say products/index.php?

BTW, is the path to the templates supposed to be this: /Applications/MAMP/htdocs/dev.genesistoday.com/templates

or this: /Applications/MAMP/htdocs/dev.genesistoday.com/templates/default_site/

5

If you are running from localhost:8888, then locally you are essentially running these sites from subdirectories. So the .htaccess you are using (RewriteRule ^(.*)$ /index.php/$1 [L]) is sending requests to http://localhost:8888/index.php.

Try the second exception from the user guide:

RewriteRule ^(.*)$ index.php/$1 [L]

Notice there is no / in front of the index.php. You will also want to remove the RewriteBase / otherwise it will prepend that to your rules, which you don't want in this case.

| improve this answer | |
  • Yes, I followed your advice and removed the "/" character, restarted Apache/MySQL and it is still doing the same thing – kronus May 27 '14 at 22:13
  • Try removing the RewriteBase as well, I'd expect that's prepending the / to all of your rules. – Derek Jones May 28 '14 at 6:53
  • That was it. It worked. Thank you so much Derek – kronus May 28 '14 at 21:45
  • Okay, great. I updated the answer so it's a complete solution. Don't forget to mark it as answered so it's easier for others to find later. – Derek Jones May 28 '14 at 21:47

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.