Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url wordpress上的自定义重定向_Url_Mod Rewrite_Url Rewriting - Fatal编程技术网

Url wordpress上的自定义重定向

Url wordpress上的自定义重定向,url,mod-rewrite,url-rewriting,Url,Mod Rewrite,Url Rewriting,我正在尝试创建一个自定义重写规则,该规则将接受第二个查询字符串 当前: 我希望是: 我尝试了下面的解决方案,但似乎不起作用 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^daily-deals/(.*)$ index.php?page_id=508&category=$1 [L,NC] </IfModule> RewriteEngine Off # BEGIN Wor

我正在尝试创建一个自定义重写规则,该规则将接受第二个查询字符串

当前:

我希望是:

我尝试了下面的解决方案,但似乎不起作用

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^daily-deals/(.*)$ index.php?page_id=508&category=$1 [L,NC]

</IfModule>
RewriteEngine Off


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

重新启动发动机
重写基/
重写规则^daily deals/(.*)$index.php?page_id=508&category=1[L,NC]
发动机熄火
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress
任何想法都将不胜感激

非常感谢你的想法

RedirectMatch 301 daily-deals/(.*)$ [[GENERATED URL WHERE YOU WANT TO REDIRECT]]
创意#2

您可以使用