LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 01-18-2010, 03:42 AM   #1
ravibhure
Member
 
Registered: May 2007
Posts: 75

Rep: Reputation: 15
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.
 
Old 01-19-2010, 05:41 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
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
 
Old 01-21-2010, 10:12 PM   #3
ravibhure
Member
 
Registered: May 2007
Posts: 75

Original Poster
Rep: Reputation: 15
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

Last edited by ravibhure; 01-21-2010 at 10:14 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
URL rewrite rule not working... vikram_cvk Linux - Software 1 12-03-2008 03:14 AM
Apache rewrite rule help - dynamic url to static page DukeLeto Linux - Software 3 11-12-2008 12:26 PM
rewrite rule base url apache2 sinister1 Linux - Software 3 11-23-2007 11:17 AM
Apache rewrite rule help kinetik Linux - Software 1 11-05-2007 12:18 PM
i need a rewrite rule!help arcow Linux - Enterprise 1 07-03-2007 06:37 AM


All times are GMT -5. The time now is 07:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration