0

私たちはワードプレスを使用しており、.htaccessには次のものがあります。

# BEGIN WordPress

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

# END WordPress

http://subdomain.example.com/select-a-card/?q=fuelのようなURLがあり、http ://subdomain.example.com/fuel-のように書き直したいと思います。カード/

これを行うには、htaccessに何を追加する必要がありますか?また、これはGET変数を使用する実行からのクエリに影響しますか?

4

1 に答える 1

1

何もありません。ワードプレスのマニュアルを読んで設定を編集するだけです。チェックアウトhttp://codex.wordpress.org/Using_Permalinks

- - 編集

これは実行できますが、書き換えたいURLの標準的なマークアップがある場合に限ります。つまり。カード選択URLのみを書き換えたい場合、またはhttp://site.com/uri/?q=somethingのような構文のURLのみを書き換えたい場合。ただし、URLの構文が大きく異なる場合は、多くの書き換えを追加する必要があります。

この特定のケースでは、次のようなものが機能するはずです。

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # add your specifics below:
    RewriteRule ^/select-a-card/\?q=(.*) $1-card/

    RewriteRule . /index.php [L]
</IfModule>
于 2012-04-20T14:08:12.143 に答える