views:

104

answers:

1

Hello

I have a domain and a wordpress-blog on same server. Now I have a problem (surprise). The wordpress is located on /httpdocs/blog/ and domain is pointing to /httpdocs/ and I'm trying to redirect it to /httpdocs/domain/. But, obvisiously, I have permalinks in Wordpress.

Here's my current .htaccess:

RewriteEngine On

RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]

RewriteBase /
RewriteCond %{HTTP_HOST} domain.com
RewriteCond %{REQUEST_URI} !^/domain
RewriteCond %{REQUEST_URI} !^/cgi-bin
RewriteRule ^(.*)$ domain/$1 [L]

But as you already propably assumed, this doesn't work. Wordpress' permalinks affects to /domain/ also, so my images and other urls go wrong.

Any advice? Is it possible to use RewriteBase like this?

Martti Laine

+1  A: 

No, you can only have one base URL. Just rewrite your rules:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blog/. /blog/index.php [L]

RewriteCond %{HTTP_HOST} =example.com
RewriteCond %{REQUEST_URI} !^/domain
RewriteCond %{REQUEST_URI} !^/cgi-bin
RewriteRule ^(.*)$ domain/$1 [L]
Gumbo
Wow, thanks! I can always trust to Stackoverflow!
Martti Laine