1) Changed the site url option in the database to http://localhost/sitename.com/
2) Changed permalinks structure to default
But when links on the local site were clicked parts of the urls were duplicated. For example this link (as it is in source view for the index page, with sitename.com replacing my site's name):
http://localhost/sitename.com/?page_id=129
when clicked, took me to:
http://localhost/sitename.com/localhost/sitename.com/?page_id=129
Which just returned me to the xampp landing page. My .htaccess file looked like this:
- Code: Select all
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Any ideas as to what was causing this and how I can fix it? I have applied a fix by changing the second RewriteRule line in .htaccess to:
- Code: Select all
RewriteRule . /sitename.com/index.php [L]
Now the links do work, although the address is now:
http://localhost/sitename.com/localhost/sitename.com/localhost/sitename.com/localhost/sitename.com/localhost/sitename.com/?page_id=129
Even stranger! So while it seems to be working the url generated above is obviously not ideal. Disabling mod_rewrite stops the links working at all, and getting rid of the first RewriteRule line cuts down the number of duplications to 2, and the links still work. However I don't have much understanding of the htaccess file, I'm just trying things at random.
All help appreciated. Thanks,
Will