| Author |
|
tijntje84 Newbie

Joined: 25 November 2007
Online Status: Offline Posts: 11
|
| Posted: 17 December 2011 at 10:04am | IP Logged
|
|
|
Hello,
i am trying tot work with rewrite, but it doensn't work fine for me. Could you guys please help me out.
I got several links:
I use http://www.domain.nl/assortiment/default.asp?naam=Gazelle&p=1&id=2
I need
http://www.domain.nl/assortiment/gazelle/1/2/
Rewrite: RewriteRule /assortiment/(\d+)/(\d+)/(\d+)/? /default.asp?naam=$1&p=$2&id=$3 [L,I,I]
I use
http://www.domain.nl/assortiment/default.asp?naam=Gazelle&afm=30x30&id=2&p=1
I need
http://www.domain.nl/assortiment/gazelle/30x30/2/1/
RewriteCode:
RewriteRule /assortiment/(\d+)/(\d+)/(\d+)/? /default.asp?naam=$1&afm=$2&id=$3&p=$4 [L,L,I,I]
Can anyone help me, cause i really just dont understand the logica... Thanks already.
Martijn
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8119
|
| Posted: 18 December 2011 at 3:14am | IP Logged
|
|
|
RewriteRule /assortiment/(\w+)/(\d+)/(\d+) /assortiment/default.asp\?naam=$1&p=$2&id=$3 [I,L]
RewriteRule /assortiment/(\w+)/([^/]+)/(\d+)/(\d+) /assortiment/default.asp\?naam=$1&afm=$2&id=$3&p=$4 [I,L]
Edited by Lexey - 20 December 2011 at 1:45am
|
| Back to Top |
|
| |
tijntje84 Newbie

Joined: 25 November 2007
Online Status: Offline Posts: 11
|
| Posted: 18 December 2011 at 3:47pm | IP Logged
|
|
|
Hello Lexey,
I just wanted to test it, but is your rewriteRule 2.0 or 3.0, because my hostingprovider got 2.0 and it doenst work for me yet..
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8119
|
| Posted: 19 December 2011 at 2:53am | IP Logged
|
|
|
These rules are for the v2. Show me URLs you are using to test these rules, please.
|
| Back to Top |
|
| |
tijntje84 Newbie

Joined: 25 November 2007
Online Status: Offline Posts: 11
|
| Posted: 19 December 2011 at 3:12am | IP Logged
|
|
|
http://www.domain.nl/assortiment/subgroep/1/
RewriteRule /assortiment/(\w+)/(\d+) /default.asp\?p=$1&id=$2 [I,L]
�
Edited by Lexey - 23 December 2011 at 4:56am
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8119
|
| Posted: 20 December 2011 at 1:44am | IP Logged
|
|
|
Your rule is almost correct. Just one slash is needed at the end of the pattern:
RewriteRule /assortiment/(\w+)/(\d+)/ /default.asp\?p=$1&id=$2 [I,L]
|
| Back to Top |
|
| |
tijntje84 Newbie

Joined: 25 November 2007
Online Status: Offline Posts: 11
|
| Posted: 21 December 2011 at 1:48am | IP Logged
|
|
|
Hello Lexey,
Thanks for your response. I just tested it, but it still doesn't seem to work.
Is there another way to test this?
|
| Back to Top |
|
| |
tijntje84 Newbie

Joined: 25 November 2007
Online Status: Offline Posts: 11
|
| Posted: 21 December 2011 at 4:35am | IP Logged
|
|
|
I just called my webhostin provider, because I didn't understood why my rewrite url didn't work.
They gave me the explanation that my new website is installed on a new server. And this server doesn't support ISAPI_Rewrite.
I have to copy the website to an older server, which support ISAPI_Rewrite, or I have to use .htaccess
They told me that .htaccess is in this case a better solution. So Lexey, your rule did work. It was a problem with my server.
|
| Back to Top |
|
| |
tijntje84 Newbie

Joined: 25 November 2007
Online Status: Offline Posts: 11
|
| Posted: 22 December 2011 at 4:36am | IP Logged
|
|
|
Hello Lexey,
can you change my domainname in my post.. to www.domain.nl? Because in google i can already find this domainname.
Thanks already!
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8119
|
| Posted: 23 December 2011 at 4:56am | IP Logged
|
|
|
Done.
|
| Back to Top |
|
| |