Hi,

Alex wrote:
> I've already asked this question on a number of apache forums and have
> received no response. I hoped someone here could help me understand
> why this rewriterule doesn't work:
> 
>       RewriteRule ^/index.php\?option=login$  /register       [R=301,L]

I think you may be caught by RewriteRule not matching
against query strings. Per the docs:

    What is matched?
        ...
        * If you wish to match against the hostname, port,
          or query string, use a RewriteCond with the
          %{HTTP_HOST}, %{SERVER_PORT}, or %{QUERY_STRING}
          variables respectively.

Source:
https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#what_is_matched

I believe you want to use something like:

    RewriteCond %{QUERY_STRING} ^option=login$
    RewriteRule ^/index.php?$   /register       [R=301,L]

It's been a while since I've done this, so I'm not sure
whether the "?" after index.php is matched.  You may need to
adjust that pattern.

-- 
Todd

Attachment: signature.asc
Description: PGP signature

_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org

Reply via email to