Solved

Help with rewrite rule

Posted on 2006-07-12
9
254 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
Comment Utility
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
Comment Utility
0
 
LVL 24

Expert Comment

by:slyong
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:ebeyrent
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Service "nameserver" appears to be down 4 473
Stop people from trying to get into my server 8 101
maven set up 2 103
PHP in Apache server 20 81
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
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 …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now