views:

54

answers:

2

I use wordpress for personal blog. Now I want to make it my personal website. Hence, I'd like the URL to be mysite.com rather than mysite.com/blog (e.g. mysite.com/2009/10/blog-entry rather than mysite.com/blog/2009/10/blog-entry)

A simple way is to move /blog/* to /blog. But this will make Wordpress files mess up with existing files I stored in /

What I did was: - Create .htaccess in /

<IfModule mod_rewrite.c>
RewriteEngine On

# Automatically send to blog when entering homepage (no requestfile supplied)
RewriteBase /
RewriteRule ^$ /blog/index.php [L]

# When inside blog, parse parse stuff
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

# END WordPress

It solved the problem. HOWEVER:

  • all the css and js and embed uploaded image DON'T work, as mod_rewrite would keep rewriting this.
  • mysite.com/wp-admin doesn't work, since it will be rewritten as mysite.com/blog/index.php?...=wp-admin

Is there a way to solve this problem?

A: 

Why not just add additional blocks, with the appropriate per-file or per-directory RewriteCond conditions? I think that may be your only option.

Maas
Sorry I still don't quite get what you meant? Additional blocks per what files/dirs?
huy
A: 

Try this rule:

RewriteRule !^blog(/|$) blog%{REQUEST_URI}
Gumbo