0

What i'm trying to do is rewrite the following pattern

http://example.org/path?articleid=5657

to this pattern:

http://example.org/path?p=5657

Essentially it comes down to changing the key to the url parameter, i have searched extensively with no clear example of how to do this exact thing using only htaccess rewrite rules.

i've tried this general approach with no luck

RewriteCond %{QUERY_STRING} ^articleid=([0-9]*)$ 
RewriteRule ^articleid=([0-9]*)$ /?p=$1 [R=301,L] 

1 Answer 1

1

You can't match against the query string in the pattern of a rule, you need to match against the URI:

RewriteCond %{QUERY_STRING} ^articleid=([0-9]*)$ 
RewriteRule ^path$ /path?p=$1 [R=301,L] 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.