I am bad at British.

I personally use Ubuntu10.04(ja).

I installed pukiwiki(wiki) in /var/www/mypukiwiki. I wish to access this site like "http://XX.XX.XX.XX" and redirect "http://XX.XX.XX.XX/pukiwiki" and "http://XX.XX.XX.XX/pukiwiki/" to "http://XX.XX.XX.XX". So, I modified my default configuration file below.

    DocumentRoot /var/www/mypukiwiki
    RewriteEngine on
    RewriteRule /pukiwiki/(.*) /$1 [R]
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/mypukiwiki>
            Options Indexes FollowSymLinks MultiViews
            #AllowOverride None
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

But, Apache redirect only "http://XX.XX.XX.XX/pukiwiki/" to "http://XX.XX.XX.XX". Apache cannot redirect "http://XX.XX.XX.XX/pukiwiki/" to "http://XX.XX.XX.XX".

Why? I wish to know correct configuration.

Can you assist me to?

Change:

RewriteRule /pukiwiki/(.*) /$1 [R]

to:

RewriteRule ^/pukiwiki/?(.*) /$1 [R,L]

The ^ at first from the match would be to ensure you are matching right from the start from the path, and never match against something similar to "/foo/bar/pukiwiki", the ? following the slash signifies it's optional.