Jumprit's Knowledge

Jumprit's knowledge and references to share.

WordPress .htaccess Localhost to Live Site —

If you have done a mod rewrite of the WordPress URL at live site for example, rewriting unfriendly URLs like:

http://www.thisisyourwordpresswebsite.com/?p=4
to keyword based URLs like:
http://www.thisisyourwordpresswebsite.com/thisisyourkeyword

You need to tweak the .htaccess to function it properly when you are doing a work at XAMPP localhost (assuming you have placed all your files in htdocs under “wordpress” folder):

So if this is the original .htaccess containing the mod rewrite rules for permalinks at live server:

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

The modified .htaccess which will work in XAMPP localhost under wordpress folder should be: 

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

That’s all.


Categorised as: Wordpress | XAMPP



Leave a Reply