Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

More RewriteRule issues ..

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


adam.p.reynolds at gmail

Nov 23, 2009, 6:23 PM

Post #1 of 3 (350 views)
Permalink
More RewriteRule issues ..

Hi,

I have the following rules in my .htaccess.

RewriteRule products/(.*)/ /index.php?view=products&brand=$1 [L]
RewriteRule products/(.*)/(.*)/ /index.php?view=productdetail&brand=$1&id=$2
[L]

These are the urls the users see:
http://www.mysite.com/products/product-name/
http://www.mysite.com/products/product-name/1/

These are the pages the users see:
http://www.mysite.com/index.php?view=products&brand=product-name
http://www.mysite.com/index.php?view=productdetail&brand=product-name&id=1


I want to add another rule rewrites the folowing url.
http://www.mysite.com/products/product-name/?filter=10

to

http://www.mysite.com/index.php?view=products&brand=product-name&filter=10

Can someone please show me how to implement this rule without interferring
with the existing second rule ?

Thanks,
Adam


--
View this message in context: http://old.nabble.com/More-RewriteRule-issues-..-tp26489575p26489575.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


Owen.Boyle at six-group

Nov 24, 2009, 12:38 AM

Post #2 of 3 (329 views)
Permalink
RE: More RewriteRule issues .. [In reply to]

> -----Original Message-----
> From: bearsfoot [mailto:adam.p.reynolds [at] gmail]
> Sent: Tuesday, November 24, 2009 3:24 AM
> To: users [at] httpd
> Subject: [users [at] http] More RewriteRule issues ..
>
>
> Hi,
>
> I have the following rules in my .htaccess.
>
> RewriteRule products/(.*)/ /index.php?view=products&brand=$1 [L]
> RewriteRule products/(.*)/(.*)/
> /index.php?view=productdetail&brand=$1&id=$2
> [L]
>
> These are the urls the users see:
> http://www.mysite.com/products/product-name/
> http://www.mysite.com/products/product-name/1/
>
> These are the pages the users see:
> http://www.mysite.com/index.php?view=products&brand=product-name
> http://www.mysite.com/index.php?view=productdetail&brand=produ
ct-name&id=1
>
>
> I want to add another rule rewrites the folowing url.
> http://www.mysite.com/products/product-name/?filter=10
>
> to
>
> http://www.mysite.com/index.php?view=products&brand=product-na
me&filter=10
>
> Can someone please show me how to implement this rule without
> interferring
> with the existing second rule ?

What did you try yourself already? What results did you get? What
problems did you encounter?

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.

Hint: A query-string is NOT part of the URL and so is not immediately
visible to a RewriteRule. For further details, check out:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule (and
read the grey box "what is matched?")
http://wiki.apache.org/httpd/RewriteQueryString


>
> Thanks,
> Adam
>
>
> --
> View this message in context:
> http://old.nabble.com/More-RewriteRule-issues-..-tp26489575p26
489575.html
> Sent from the Apache HTTP Server - Users mailing list archive
> at Nabble.com.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>

This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message.
The sender's company reserves the right to monitor all e-mail communications through their networks.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


j.zuckerman at gmail

Nov 24, 2009, 12:26 PM

Post #3 of 3 (326 views)
Permalink
Re: More RewriteRule issues .. [In reply to]

On Tue, Nov 24, 2009 at 12:38 AM, Boyle Owen <Owen.Boyle [at] six-group> wrote:
>> -----Original Message-----
>> From: bearsfoot [mailto:adam.p.reynolds [at] gmail]
>> Sent: Tuesday, November 24, 2009 3:24 AM
>> To: users [at] httpd
>> Subject: [users [at] http] More RewriteRule issues ..
>>
>>
>> Hi,
>>
>> I have the following rules in my .htaccess.
>>
>> RewriteRule products/(.*)/ /index.php?view=products&brand=$1 [L]
>> RewriteRule products/(.*)/(.*)/
>> /index.php?view=productdetail&brand=$1&id=$2
>> [L]
>>
>> These are the urls the users see:
>> http://www.mysite.com/products/product-name/
>> http://www.mysite.com/products/product-name/1/
>>
>> These are the pages the users see:
>> http://www.mysite.com/index.php?view=products&brand=product-name
>> http://www.mysite.com/index.php?view=productdetail&brand=produ
> ct-name&id=1
>>
>>
>> I want to add another rule rewrites the folowing url.
>> http://www.mysite.com/products/product-name/?filter=10
>>
>> to
>>
>> http://www.mysite.com/index.php?view=products&brand=product-na
> me&filter=10
>>
>> Can someone please show me how to implement this rule without
>> interferring
>> with the existing second rule  ?
>
> What did you try yourself already? What results did you get? What
> problems did you encounter?
>
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored.
>
> Hint: A query-string is NOT part of the URL and so is not immediately
> visible to a RewriteRule. For further details, check out:
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule (and
> read the grey box "what is matched?")
> http://wiki.apache.org/httpd/RewriteQueryString
>
>
>>
>> Thanks,
>> Adam
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/More-RewriteRule-issues-..-tp26489575p26
> 489575.html
>> Sent from the Apache HTTP Server - Users mailing list archive
>> at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP
>> Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe [at] httpd
>>    "   from the digest: users-digest-unsubscribe [at] httpd
>> For additional commands, e-mail: users-help [at] httpd
>>
>>
>
> This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message.
> The sender's company reserves the right to monitor all e-mail communications through their networks.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
>   "   from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>

This is an end-user to end-user help list for the Apache webserver, if
the listserv description was accurate, we would help you get
mod_rewrite *installed* and stop right there. It sounds like what you
really are asking for help with is regular expressions - which we're
all happy to help with, but we'll need a little bit more info and some
re-assurance that you're going far enough by reading the manual and
trying to help yourself.

Specifically addressing your problem, I think you're interested in the
flag "QSA" (query-string all). Check it out in the link that Owen
directed you to, or this site which has a nicely condensed version:
http://www.addedbytes.com/apache/mod_rewrite-cheat-sheet/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.