0

画像フォルダへのすべてのリクエストが1つのフォルダを指すように作成できるルールはありますか?私はたくさんのリンクを扱っているので、入れたくありません../

例: http: //hostingxtreme.com/ajax/images/logo.png

http://hostingxtreme.com/images/logo.pngになる必要があります

ありがとう

ここでは、Dosentを使用しているコードが機能しているようです。
php_value register_long_arrays On
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine On
RewriteRule ^/?ajax/images/logo.png$ /images/logo.png [L,R=301]
</IfModule>

4

2 に答える 2

1

ドキュメント ルートの htaccess ファイルに、次のいずれかを追加します。

Redirect 301 /ajax/images/logo.png /images/logo.png

または、mod_rewrite を使用する必要がある場合:

RewriteEngine On
RewriteRule ^/?ajax/images/logo.png$ /images/logo.png [L,R=301]
于 2012-10-27T21:21:28.960 に答える
0

わかった!

RewriteCond %{REQUEST_FILENAME} !-d  
RewriteCond %{REQUEST_URI} (ajax/|ajax/.*/)images/(.*)  
RewriteRule (ajax/|ajax/.*/)images/(.*) images/$2  

RewriteCond %{REQUEST_FILENAME} !-d  
RewriteCond %{REQUEST_URI} (ajax/|ajax/.*/)stylesheets/(.*)  
RewriteRule (ajax/|ajax/.*/)stylesheets/(.*) stylesheets/$2
于 2012-10-28T06:51:59.610 に答える