2010-12-14 5 views
0

mod_rewriteを使用してURLをクリーンアップしようとしています。私は私のURLでmod_rewriteを使用したURLのクリーニング

:私は上記のURLを入力すると

http://blog.com/cat/post1/index.html 
http://blog.com/cat/post2/index.html 
http://blog.com/cat/post3/index.html 
etc.... 

の.htaccess

RewriteEngine on 
RewriteCond %{THE_REQUEST} ^GET\ /.*/index\.(php|html)\ HTTP 
RewriteRule (.*)index\.(php|html)$ /$1 [R=301,L] 

は私が手:

http://blog.com/post1/ 

しかし、私がしたい:

http://blog.com/cat/post1/ 

私はここで間違っていますか?

答えて

1
RewriteEngine on 
RewriteCond %{THE_REQUEST} ^GET\ /.*/index\.(php|html)\ HTTP 
RewriteRule (.*) http://blog.com/cat/$1 [R=301, L] 
+0

私とは連携しませんでした。それはまだ "http://blog.com/post1/"にリダイレクトされています404 – Maca

+0

編集済み嘆願書チェック –

+0

実際に私は変更することができます(私は文書を編集した)mutitple URLがあります。 http://blog.com/cat/post1/index.html、http://blog.com/cat/post2/index.htmlなど... – Maca

関連する問題