Avatar of sharingsunshine
Flag for United States of America asked on

Need To Remove Appended %3F from URL.

I need to remove an encoded ? (%3F) off of several url's.  I want to use Mod_Rewrite to accomplish that.  Here is my regex but it itsn't working.

RewriteRule ^index\.php\?controller=cms&id_cms=([0-9]+)%3F$ /index.php?controller=cms&id_cms=$1 [R=301,L]

Open in new window

This is what the original url looks like

Open in new window

Please tell me how to get rid of the %3F appended to the url.
Regular Expressions* mod_rewriteApache Web Server

Avatar of undefined
Last Comment

8/22/2022 - Mon
Dr. Klahn

The regex does not match the URL.  Two reasons.

1.  The URL begins with a slash.  The regex does not.  Add a leading slash on the regex.

2.  The URL contains no underscore between "cms" and "id" -- id cms.  The regex contains an underscore -- id_cms.  Replace the underscore with a space in the regex.

I have looked at your response numerous times and I see id_cms on the regex pattern and on the url.  So to remove this misunderstanding could you please show me what you have gotten to work in a tester.

Dr. Klahn

On my screen there is no underscore between "id cms".

Missing space
Regarding testing the regex, as a long-time EE user you must know that testing with a regex tester is not a substitute for testing in the operational environment.  Only you can test on the actual system.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.

Wow, that is strange.  Here is what I posted on the original question.  https://gyazo.com/d67e931d75df84a9259e87fd48bb7b0e

You are correct about testing but at least you can get close with a tester.

This is the tester I use and I did add the slash based on your suggestion but it still doesn't match

Steve Bink

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Great job, thanks so much for the help.