web-dev-qa-db-ja.com

フォルダの名前を変えずにwp-contentを変える

これは動作しません

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteRule ^/index\.php$ - [L]
RewriteRule ^/css/(.*) /wp-content/themes/themename/css/$1 [QSA,L]
RewriteRule ^/js/(.*) /wp-content/themes/themename/js/$1 [QSA,L]
RewriteRule ^/img/(.*) /wp-content/themes/themename/img/$1 [QSA,L]
RewriteRule ^/font/(.*) /wp-content/themes/themename/font/$1 [QSA,L]
RewriteRule ^/plugins/(.*) /wp-content/plugins/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
1
Moustafa

次のスラッシュをあなたのルールから取り除きます。

例(正しくない)

RewriteRule ^/css/(.*) /wp-content/themes/themename/css/$1 [QSA,L]

例(正しい)

RewriteRule ^css/(.*) wp-content/themes/themename/css/$1 [QSA,L]

すべての規則(正しい)

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteRule ^/index\.php$ - [L]
RewriteRule ^css/(.*) wp-content/themes/themename/css/$1 [QSA,L]
RewriteRule ^js/(.*) wp-content/themes/themename/js/$1 [QSA,L]
RewriteRule ^img/(.*) wp-content/themes/themename/img/$1 [QSA,L]
RewriteRule ^font/(.*) wp-content/themes/themename/font/$1 [QSA,L]
RewriteRule ^plugins/(.*) wp-content/plugins/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
0
userabuser