I'm trying to make this rewriterule via htaccess file in wordpress I have the following url: https://domain_name.com/index.php/field/value_to_be_written and I want it to be internally redirect to: https://domain_name.com/index.php/field/?get_value=value_to_be_written
I have this following code but it's giving me error 500:
RewriteRule ^index.php/field/(.*)$ index.php/field/?get_value=$1 [L]
Any help would be great. Thanks in advance.
You just need leading slashes:
RewriteRule ^/index\.php/field/(.*)$ /index.php/field/?get_value=$1 [L]
Excerpt from 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]
Please try not sure
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.