2

I have to reinstall it because i f'up by changing "localhost" to "mysite.dev" on the installation page.

0
5

To delete craft, all you need to do is delete the craft/app folder, so you don't lose all your templates/plugins etc. That said, this won't affect your site url as siteUrl stored in the database.

Here are a few options:

  1. You would need to go into the database under the table craft_info and then change siteUrl back to localhost or whatever you need it to be.

  2. If you have only just gone through the installation page then you can just delete the database and start again.

My most preferred thing to do to avoid these sort of issues is to set the siteUrl within a config file and simply reference it.

For example in craft/config/general.php you would have:

return array(
 '*' => array(
   'environmentVariables' => array(
     'siteUrl' => 'localhost'
   )
 ),
 '.com' => array(
   'environmentVariables' => array(
     'siteUrl' => 'http://somedomain.com'
   )
 )
);

So basically here we are setting the siteUrl config within a wildcard config using * which means it gets applied to all environments.

Straight after we are then overriding the siteUrl config for just .com domains.

See Multi environment config and Multi environment variables

The beauty of this is now when you install Craft (or change siteUrl in the database) you only need to put {siteUrl} within the input and Craft will automatically fetch the value from your config file, based on your environment.

Hope that helps!

1
  • That helps! I ended up deleting the database. Never knew the contents of db.php is still there and back again even though i deleted the whole craft folder. Jun 7 '16 at 11:18

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.