Help with rewrite rule

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

I am trying to come up with a rewrite rule for the following:,,520797p,rsc270619,0,0,Index,ck_.html

maps to

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

Expert Comment

ID: 17096701

Sorry I am not very clear, are you trying to rewrite something like:,520797520797p,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

Author Comment

ID: 17098564
LVL 24

Expert Comment

ID: 17103488

sorry about the confusion, you want:,,520797p,rsc270619,0,0,Index,ck_.html
maps to

This should do:
RewriteRule ^inner.php?59,,520797p,rsc270619,0,0,Index,ck_.html$ about/press [L]
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.


Author Comment

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


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.
LVL 27

Accepted Solution

caterham_www earned 43 total points
ID: 17115863
What about

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

Assisted Solution

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.
LVL 10

Assisted Solution

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.

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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