?
Solved

Help with rewrite rule

Posted on 2006-07-12
9
Medium Priority
?
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Thank you, but that's not exactly what I need.

I need to rewrite

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

to

http://www.mysite.com/about/press
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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 172 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 164 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 164 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

777 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