473,788 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

url rewriting

realin
254 Contributor
hi guys,

i have done URL rewriting thing after visitng many sites.. now the problem is i am unable to do it for two different urls, an example can be
[HTML]

http://domain.com/learn.php?actio n=view&id=7
http://domain.com/learn.php?actio n=read&id=1

[/HTML]
now the rule i am using is like this ..
Expand|Select|Wrap|Line Numbers
  1. RewriteEngine on
  2. RewriteRule ^learn/(.*)/(.*)$ learn.php?action=$1&id=$2 [L]
  3. RewriteRule ^learn/(.*)/(.*)$ learn.php?action=$1&cat=$2 [L]
  4.  
i have also tried changing [L] to [NC] but no luck :(
now i can view the second URL using the
http://domain.com/learn/read/1
and
when i use
http://domain.com/learn/view/1

i just cant get the value of cat from the URL.. however my script is same in both the cases.. it takes teh value like this

[PHP]$_REQUEST['id']
or
$_REQUEST['cat'][/PHP]

please help me guys

thank you..
Nov 2 '07 #1
1 1129
realin
254 Contributor
well the solution was simple i changed the later URL to http://domain.com/learn.php?actio n=view&id=9
that means instead of cat i again placed ID, actually there was an ambiguity in the rule, cause both of them were almost same and it used to pick the first rule by default.. so by removing this ambiguity its working like a charm ;)
Nov 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
8656
by: Jon Maz | last post by:
Hi All, I am experimenting with URL Rewriting using the techniques outlined by Scott Mitchell in his article "URL Rewriting in ASP.NET" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/htm l/urlrewriting.asp). In the article he mentions a problem with postbacks: "If the URLs you are rewriting contain a server-side Web Form and perform postbacks, when the form posts back, the underlying URL will be used". His...
3
3271
by: Jamie Jackson | last post by:
I'm rewriting all links' onclick events, but I'm having a problem. The onclick event that I'm inserting works correctly in Opera, but not in FF or IE. I'm retroactively adding the statement "return promptBeforeOpening();" FF and IE rewrite it as I would expect them to, but it turns out that that doesn't work (no disclaimer pops up, and the link is not disabled):
2
2602
by: Jon Maz | last post by:
Hi All, I've been looking into options for URL Rewriting in .net, and to be honest, I haven't seen anything that's easier than the old Classic Asp solution with an ISAPI filter redirecting to an .asp page with responsibility for handling the redirect. I'm now planning to use this solution with my next .net project, and was wondering if anyone else out there has done this already, and what problems (if any) arise. Hopefully the news...
3
2751
by: Michael Appelmans | last post by:
I'm trying to use a rule based URL rewrite application which uses HttpApplication.RewritePath. I keep getting "rsource not found" error in application when running on shared web host although the software runs fine on my localhost. Is it possible that the web hosting service has configured something in the machine.config file to disable URL rewriting? I have been communicating with them but they seem clueless as to the cause. Thanks for...
2
2468
by: R-D-C | last post by:
Can these two functions coexist? We have a web site where the querystrings are removed using URL Rewriting. Instead the page appears to be a html page with a long name (containing what would be in the querystring). I have tried switching on output caching and varying by a parameter and using VaryByCustom but the caching simply does not work. Tested it by adding the time to the bottom of the page and the time updates every time we...
0
2131
by: Lee | last post by:
Hi all ;) Preamble -------- I'm using URL rewriting to enforce a frames policy (yeah, I know frames are 'bad' :) - i.e. if a request comes in for a page which should be nested within a frameset, the url is rewritten to something of the form 'http://www.blah.com/framesdoc.aspx?lowerFrame=/page.aspx', the 'framesdoc' page then dynamically generates the src attribute for the
3
4744
by: Greg Collins [Microsoft MVP] | last post by:
I have done a bit of research of Url Rewriting, but as yet have been unsuccessful at getting it to work well, and there are issues around what file types are supported and how much code you want to write. While working on a similar, though partially unrelated, issue, I came across a possible alternate method. Before I pursue this method in full, I wanted to get opinions of others as to any unforseen issues I might encounter. The method is...
9
628
by: Frankie | last post by:
I understand that with URL rewriting we can have a request come in for, say Page1.aspx, and rewrite it so that PageA.aspx gets served up to the user. My question (assuming the above is correct): What does the user see in the browser after URL Rewriting? In the above case, when PageA is rendered to the browser, will the address bar show "PageA.aspx" or would it show "Page1.aspx" - the originally requested URL? Thanks.
2
2353
by: Seth Williams | last post by:
The first scenario is that I want to create one website for a particular industry - let's say for Farm Machinery so I have a shared hosting site called myFarmMachinery.com But I want to sell site creation, using database page creation to multiple companys who generally have their own domain name. So, then, these domains, I need to forward to my one IP address for myFarmMachinery.com
1
7889
Shinobi
by: Shinobi | last post by:
I am using ASP.net(c#) for my project. In my my project 2 pages are using URL rewriting method by referring this article URL Rewriting using Intelligencia UrlRewriter Example 1 - Blog Day Afternoon from my form i used this code. Response.Redirect("showdetails/" + a); in my Web.config <system.webServer>
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.