I’ve done this a few times … what you need to do is
1. Download your .htaccess file from the /wordpress/ folder.
1. (preferably using file manager in cpanel as it’s fastest) Copy all the files in the /wordpress folder to the root folder (usually public_html).
2. Go into the wp-admin area (as you would normally do, and under Settings / General, change the URL to the new address. Once this is done you won’t be able to log in to the old area.
3. Change the htaccess file from this
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
To this:
# 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
Add this to the file
redirect 301 /wordpress http://yournewurl.com/
redirect 301 /wordpress/ http://yournewurl.com/
4. re-upload this altered .htaccess file to the new (root) directory.
If there are any other index.html files in the root folder, rename them to something like index.html2.
That should do the trick. Open up the site and the admin area with the new address and check that it is working OK.
When you are satisfied, delete the files under /wordpress/ because they’re a duplicate.
Good luck – it’s pretty nerve wracking the first time!
i have another problem when i try to download .htaccess file it says critical file transfer error.
I cannot access it through ftp or Filezilla.
🙁
Can you upload or download any other files?
If not, you will need to talk to your server people about permissions, I think.
You may also change the url used for the wordpress site by adding the Home and Site URL lines in the wp-config file. The lines that will be added are the following (change the http://example.com to your own url):
define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);
It is also possible to change the url in the database used for the site by accessing the phpmyadmin.
Please also refer to this link, this can help.
http://codex.wordpress.org/Changing_The_Site_URL
You are accessing the phpmyadmin then change the ulr in the database which is used for your site. There is no need to code manually your .htaccess and config file only change the url from phpmyadmin .
I tried this
define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);
The website is gone. It says Error occurred: 500 – internal server error
Apache Server at: d1106212-17580.myweb.iinethosting.net.au
How do i get my site back.
I tried function.php but it did not work either. Still the same error
I need to really fix this.
It sometimes says
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
Adsense?? that’s some advertising site.
Anyway i called my hosting provider they fixed the PHP installation error.
I made changes to url from phpmyadmin.
It is working now. Thank you all for your help. I learned something new.