Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Download Wordpress project and develop locally

I downloaded a wordpress project from C panel and want to develop locally. the wp-config.php is set to local, but when i open the site locally , i got 404 page not found, it may be caused by url direct, how to fix this?

Not sure, but have you setup your local testing server and database? If so, then the issue might be that permalinks weren't updated.

2 Answers

You just need to update a couple of areas to match your directory structure where WordPress is installed:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mySite/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /mySite/index.php [L]
</IfModule>
# END WordPress

Hi Chao,

Aside from the wp-config.php setup you will likely need to modify your local .htacess file so that your RewriteBase and RewriteRule settings are accurate.

the folder structure looks like this: localhost/mySite/ how should i modify the .htacess file to match this folder structure