[英]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.