Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I asked this question in Stackoverflow but one of the respondents told me to ask it in here instead. I wonder if this is something that can be done in htaccess?

I have this URL:

https://www.website.com/folder/New.jsp?par=new1 

...which I want to redirect to:

 https://www.website.com/folder/New.jsp

how should I do that?

Basically I have par=new1|new2|new3|new4 that would like to be redirected to https://www.website.com/folder/New.jsp.

Any help from you will be very much appreciated. Thanks!

share|improve this question

1 Answer 1

If you just need the parameters taken off, it's pretty straight forward

RedirectMatch https://www.website.com/folder/New.jsp(\?par=.[a-z])  https://www.website.com/folder/New.jsp

No mod_rewrite needed.

share|improve this answer
    
Thanks, sysadmin. I'm pretty new with this mod_rewrite so please forgive me with my naive question. I tried to place this code in .htacess along with other redirects but it gave our site a 404. So I also tried placing it under the RewriteEngine on RewriteOptions inherit but nothing happens. Where should this be placed? –  liza Dec 14 '10 at 6:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.