繁体   English   中英

Htaccess rewriterule wordpress问题

[英]Htaccess rewriterule wordpress issue

我正在尝试通过wordpress中的htaccess文件进行此重写我有以下URL: https//domain_name.com/index.php/field/value_to_be_written我希望它在内部重定向到: https:// domain_name。 COM /的index.php /场/?的get_value = value_to_be_written

我有以下代码,但它给了我500错误:

RewriteRule ^index.php/field/(.*)$ index.php/field/?get_value=$1 [L]

任何帮助都会很棒。 提前致谢。

你只需要领先的斜杠:

RewriteRule ^/index\.php/field/(.*)$ /index.php/field/?get_value=$1 [L]

摘录自https://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewriterule

<!-- language: lang-none -->
+-----------------------------+------------------------+
| Given Rule                  | Resulting Substitution |
+-----------------------------+------------------------+
| ^/somepath(.*) otherpath$1  | invalid, not supported |
| ^/somepath(.*) /otherpath$1 | /otherpath/pathinfo    |
+-----------------------------+------------------------+
RewriteEngine On
RewriteRule ^/index\.php/field/?get_value=$1 [L]

请尽量不确定

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM