Solved

Help with rewrite rule

Posted on 2006-07-12
9
260 Views
Last Modified: 2010-03-04
Hi all,

I am trying to come up with a rewrite rule for the following:

http://www.mysite.com/inner.php?59,,520797p,rsc270619,0,0,Index,ck_.html

maps to

http://www.mysite.com/about/press

It's only important to match inner.php?59, as the rest is fairly irrelevant.
0
Comment
Question by:ebeyrent
9 Comments
 
LVL 24

Expert Comment

by:slyong
ID: 17096701
Hi,

Sorry I am not very clear, are you trying to rewrite something like:

http://www.mysite.com/about/press/,520797520797p,rsc270619,0,0,Index,ck_.html

To

http://www.mysite.com/inner.php?59,,520797p,rsc270619,0,0,Index,ck_.html

If that is the case try:
RewriteRule ^about/press/(.*)$ about/press/$1/ [R]
RewriteRule ^about/press/(.*)/$ inner.php?59,$1
0
 

Author Comment

by:ebeyrent
ID: 17098564
0
 
LVL 24

Expert Comment

by:slyong
ID: 17103488
Hi

sorry about the confusion, you want:
http://www.mysite.com/inner.php?59,,520797p,rsc270619,0,0,Index,ck_.html
maps to
http://www.mysite.com/about/press

This should do:
RewriteRule ^inner.php?59,,520797p,rsc270619,0,0,Index,ck_.html$ about/press [L]
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 

Author Comment

by:ebeyrent
ID: 17107450
We're getting closer.  I had also mentioned that what really needs to be matched is

inner.php?59

because the rest of it is session data.  So it's almost like I need something like:

^inner.php?59(.*)\.html$ about/press [L]

but it doesn't seem to work.  The URL simply doesn't change in the address bar.
0
 
LVL 27

Accepted Solution

by:
caterham_www earned 43 total points
ID: 17115863
What about

RewriteCond %{QUERY_STRING} ^59.*\.html
RewriteRule ^inner\.php /about/press [L]
0
 
LVL 24

Assisted Solution

by:slyong
slyong earned 41 total points
ID: 17115979
Hi ebeyrent,

The URL shouldn't change in the address bar but the page from about/press should be displayed.  I think if you want the address to be redirected, use [R] instead of [L] at the end.
0
 
LVL 10

Assisted Solution

by:PSSUser
PSSUser earned 41 total points
ID: 17246082
What slyong says is correct.

Url rewritting by default hides what the request has been rewritten to (it adds an extra level of obfuscation and hence security). You can use [L,R] if you need to L is to tell it that it's the last rule to apply and the R is for the redirect.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question