I have my wordpress installed on http://www.domain.nl/wp.domain.nl
With htaccess in my main directory I rewrite the url http://wp.domain.nl to http://www.domain.nl/wp.domain.nl
When I go to the shorter url I see my wordpress site.
But now I want to change the wordpress- and site address in the general settings to the shorter url, which is causing troubles.
I first only changed the site address, because the other one can be the longer one. If I then go to: http://domain.nl/wp.domain.nl/sample-page/ it shows the error page instead of the page I want to see when I have the longer url filled in.
The htaccess I use for the main domain is:
php_value upload_max_filesize 20M<br />
php_value post_max_size 20M<br />
php_value max_execution_time 200<br />
php_value max_input_time 200</p>
<p>AddHandler application/x-httpd-php .gif .jpg .jpeg .png<br />
php_flag short_open_tag Off<br />
php_flag display_errors off</p>
<p>RewriteEngine on<br />
Options +FollowSymlinks<br />
RewriteBase /</p>
<p># REDIRECT MAIN DOMAIN<br />
RewriteCond %{HTTP_HOST} ^(www.)?domain.nl$<br />
# /subfolder/<br />
RewriteCond %{REQUEST_URI} !^/www.domain.nl/<br />
# Don't change this line.<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
# /subfolder/<br />
RewriteRule ^(.*)$ /www.domain.nl/$1<br />
# site<br />
# subfolder/<br />
RewriteCond %{HTTP_HOST} ^(www.)?domain.nl$<br />
RewriteRule ^(/)?$ www.domain.nl/ [L]</p>
<p># SUBDOMAINS to /sub.domain.nl/<br />
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.nl$ [NC]<br />
RewriteCond %{HTTP_HOST} !^www\.domain\.nl$ [NC]<br />
RewriteRule ^(.*)$ http://domain.nl/%1.domain.nl/$1 [P,L]
This should do the following:
http://www.domain.nl -> http://www.domain.nl/www.domain.nl
sub.domain.nl -> http://www.domain.nl/sub.domain.nl