'Wordpress: 403 error after changing domain name

I have a wordpress instance (Version 3.5.1) installed on a third party webhoster (www.hoststar.ch). The installation on the server is in a subdirectory /test/wordpress. When I installed the wordpress instance, I gave the URL http://test.example.com as URL. Now I want to change the URL into http://www.newexample.com. I set the new URL to point to the same subdirectory on the server as the old URL. But when I open the new URL, the server gives me an 403 error, telling me:

"You don't have permission to access / on this server."

I figured out that when I change the entry "RewriteEngine On" to "RewriteEngine Off" in the .htaccess file (the one of the wordpress subdirectory, not the one in the root directory), it works with the new URL. However, the pretty permalinks do not work anymore, as the RewriteEngine is switched off.

Does somebody have an idea why I cannot access the wordpress instance with the new URL when the RewriteEngine is set to On?

Here's my .htaccess file:

# 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>

Thanks for your help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source