2.htaccess url重写规则

2.htaccess url重写规则,.htaccess,mod-rewrite,url-rewriting,rewrite,.htaccess,Mod Rewrite,Url Rewriting,Rewrite,我试图设定两条规则: 如果我输入,htaccess必须加载页面 www.mydomain.it/categoria/Cucina htaccess必须加载 我试过: RewriteCond %{REQUEST_URI} ^/?rssfeed=Cucina RewriteCond %{HTTP_HOST} ^(www.)?mydomain.it$ [NC] RewriteRule ^(.*)$ http://www.mydomain.it/categoria/Cucina [R,L] 但它不起作

我试图设定两条规则:

  • 如果我输入,htaccess必须加载页面
  • www.mydomain.it/categoria/Cucina htaccess必须加载
  • 我试过:

    RewriteCond %{REQUEST_URI} ^/?rssfeed=Cucina
    RewriteCond %{HTTP_HOST} ^(www.)?mydomain.it$ [NC]
    RewriteRule ^(.*)$ http://www.mydomain.it/categoria/Cucina [R,L]
    
    但它不起作用,如果我去,我会返回404错误

    谁能帮我

    mycurrent.htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    #rule 1
    RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.it$ [NC]
    RewriteRule ^notizie/([^/]+)$ /?rssfeed=$1 [L]
    
    #rule 2
    RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.it$ [NC]
    RewriteRule ^categoria/([^/]+)$ /?categoryfeed=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    #开始WordPress
    重新启动发动机
    重写基/
    重写规则^index\.php$-[L]
    #规则1
    重写cond%{HTTP_HOST}^(www\)?mydomain\.it$[NC]
    重写规则^notizie/([^/]+)$/?rssfeed=$1[L]
    #规则2
    重写cond%{HTTP_HOST}^(www\)?mydomain\.it$[NC]
    重写规则^categoria/([^/]+)$/?categoryfeed=$1[L]
    重写cond%{REQUEST_FILENAME}-F
    重写cond%{REQUEST_FILENAME}-D
    重写规则/index.php[L]
    #结束WordPress
    

    非常感谢

    很难帮助你,因为我看不到你的问题或你的问题。。。 我不知道你为什么要添加
    www.

    1) 将notizie/LeDelizieDiCasa重定向到
    http://www.mydomain.it/?rssfeed=LeDelizieDiCasa
    带有:

    RewriteRule notizie/LeDelizieDiCasa/? http://www.mydomain.it/?rssfeed=LeDelizieDiCasa [NC,L]
    
    2) 将
    /categoria/Cucina
    重定向到
    http://mydomain.it/?categoryfeed=Cucina

    RewriteRule categoria/Cucina/? http://www.mydomain.it/?rssfeed=LeDelizieDiCasa [NC,L]
    
    将其添加到规则1之前

    问,如果不是那样的话