Magentoでは、モジュールのURL構造は次のようになります。
example.com/[index.php]/:module/:controller/:action/:param1[/:paramN ...]
ギャラリーモジュールを作成しました。ギャラリーにはいくつかのアルバムが含まれており、各アルバムのURLは次のようになります(MagentoのURL構造に従います)。
example.com/[index.php]/gallery/controller/view/name/:album_name
しかし、ギャラリーの各アルバムのURLは次のようになります。
example.com/[index.php]/gallery/:album_name
どうすればこれを達成できますか?.htaccess Rewrite Ruleを試しましたが、間違っているようで、機能していません。これがMagentoの.htaccess書き換えルールのコピーです
<IfModule mod_rewrite.c>
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
## workaround for HTTP authorization
## in CGI environment
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
## Rewrite Rule for Gallery Module
RewriteRule ^/gallery/(.*)?$ /gallery/category/view/name/$1 [L]
## always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
## never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
## rewrite everything else to index.php
RewriteRule .* index.php [L]
</IfModule>