LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   rewrite rule for url change (http://www.linuxquestions.org/questions/linux-server-73/rewrite-rule-for-url-change-782914/)

ravibhure 01-18-2010 02:42 AM

rewrite rule for url change
 
Hi,
I want to rewrite one url using apache mod_rewrite,

myurl is
http://www.ravibhure.com/app/site/af...263120350520.8

and want to rewrite like this.
http://www.ravibhure.com/app/site/ge...263120350520.8

can anyone have an idea how I do this.

Please help me.

bathory 01-19-2010 04:41 AM

Hi,

Try this and see if it works:
Code:

RewriteEngine on

RewriteCond %{QUERY_STRING} ^mName=(.*)$
RewriteRule ^app/site/affiliate/viewChannelModule.act$ /app/site/getAdJs.esi/%1 [R]
RewriteRule ^app/site/getAdJs.esi/getAdJs(.*) /app/site/getAdJs.esi?$1 [R,L,NE]

It's a bit difficult, because your URL contains lots of special characters. Hope that it will do.

Regards

ravibhure 01-21-2010 09:12 PM

Thanks bathory,
I have tried but not luck, I have tried with some changed into string and it works

Quote:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^mName=getAdJs(.*)$
RewriteRule ^/app/site/affiliate/viewChannelModule.act /app/site/getAdJs.esi?%1
Here I just wanted to change if fouds the exact query string i.e. 'mName=getAdJs'

Thanks for your help


All times are GMT -5. The time now is 05:34 PM.