Apache 需要帮助删除特殊字符重写htaccess吗

Apache 需要帮助删除特殊字符重写htaccess吗,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,在更改了我博客上的链接后,htaccess中的301重定向问题一直困扰着我 我今天在htaccess中有以下代码: RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^.*$ http://example.com%{REQUEST_URI} [R=301,L] RewriteRule ^sitemap.xml$ sitemap.php [L] Rewriterule ^blog/(.+)/

在更改了我博客上的链接后,htaccess中的301重定向问题一直困扰着我

我今天在htaccess中有以下代码:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^.*$ http://example.com%{REQUEST_URI} [R=301,L]
RewriteRule ^sitemap.xml$ sitemap.php [L]
Rewriterule ^blog/(.+)/(.+).html$       ./blog/view/blog.php?page=$1&mode=$2 [NC]
Rewriterule ^blog/(.+).html$            ./blog/blog.php?page=$1 [NC]
Rewriterule ^blog/(.+)/$                ./blog/view/blog.php?page=$1 [NC]
Rewriterule ^blog/$                     ./blog/blog.php [NC]
RewriteCond %{REQUEST_FILENAME} !-f
Rewriterule ^blog/(.+)/(.+)$        ./blog/view/blog.php?page=$1&mode=$2 [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^blog/(.+)$ ./blog/blog.php?page=$1 [NC]
问题是,我现在在php中已经将特殊字符如“åäö”转换为“aao”,但我的旧帖子的旧链接没有重定向到新链接


有人能帮我一下吗。

这里是一个简单的例子,我基于下面的代码

下面是一个基于扩展的重定向示例,以满足您的需求

RewriteEngine On
RewriteCond %{REQUEST_URI} .html$
RewriteRule ^blog/(.*).html$ /blog/blog.php?page=$1[R=301,L]

嗨,谢谢你。我已经测试过了,但它似乎没有像我想的那样工作。