Problem adding new rule
9 posts
• Page 1 of 1
- insideinside
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Problem adding new rule
Hi.
I use these in my code below. htaccess:
Was added and it is showing error. There is something wrong under the new rule?
Thank you for your attention.
I use these in my code below. htaccess:
- Code: Select all
RewriteEngine on
RewriteRule n/(.*),(.*),(.*)--(.*)/ n.asp?c=$1&co=$2&id=$3&t=$4
RewriteRule n/(.*),(.*),(.*)--(.*) n.asp?c=$1&co=$2&id=$3&t=$4
RewriteEngine on
RewriteRule nn/(.*),(.*),(.*)--(.*)/ nn.asp?c=$1&co=$2&id=$3&t=$4
RewriteRule nn/(.*),(.*),(.*)--(.*) nn.asp?c=$1&co=$2&id=$3&t=$4
Was added and it is showing error. There is something wrong under the new rule?
- Code: Select all
RewriteEngine on
RewriteRule s/(.*)/ s.asp?s=$1
RewriteRule s/(.*) s.asp?s=$1
Thank you for your attention.
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Problem adding new rule
Hello,
You do not need "RewriteEngine on" it's from syntax v3.
I would also use '/' in the beginning of the pattern:
Regards
Andrew
You do not need "RewriteEngine on" it's from syntax v3.
I would also use '/' in the beginning of the pattern:
- Code: Select all
RewriteRule /s/(.*)/ /s.\asp?s=$1
Regards
Andrew
- insideinside
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: Problem adding new rule
Hi. Thanks for the help but i feel having problems:
The rule:
Left this link:
http://www.registro.sp.gov.br/n.asp?c=7&co=13&id=18729799&t=EMEF-Olga-Clivatti-Rodrigues-comemora-12-anos-de-atividades
To do this:
http://www.registro.sp.gov.br/n/7,13,18729799--EMEF-Olga-Clivatti-Rodrigues-comemora-12-anos-de-atividades
And now presenting problem. The above rule is not working anymore.
Another issue is that the rule you entered interfered in other site links site. For example, what was "form.asp" was only "form".
I need your rule to work without interfering with each other:
Can you help me?
The rule:
- Code: Select all
RewriteEngine on
RewriteRule n/(.*),(.*),(.*)--(.*)/ n.asp?c=$1&co=$2&id=$3&t=$4
RewriteRule n/(.*),(.*),(.*)--(.*) n.asp?c=$1&co=$2&id=$3&t=$4
Left this link:
http://www.registro.sp.gov.br/n.asp?c=7&co=13&id=18729799&t=EMEF-Olga-Clivatti-Rodrigues-comemora-12-anos-de-atividades
To do this:
http://www.registro.sp.gov.br/n/7,13,18729799--EMEF-Olga-Clivatti-Rodrigues-comemora-12-anos-de-atividades
And now presenting problem. The above rule is not working anymore.
Another issue is that the rule you entered interfered in other site links site. For example, what was "form.asp" was only "form".
I need your rule to work without interfering with each other:
- Code: Select all
RewriteRule /s/(.*)/ /s.\asp?s=$1
Can you help me?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Problem adding new rule
I didn't do anything with the rule. You were asking to make it work. I did, but the logic behind it is still the same.
Also, all your previous posts on this forum were about ISAPI_Rewrite 3, now you post in v2. It has different syntax. Please, confirm that you need ISAPI_Rewrite 2, not 3.
Regards
Andrew
Also, all your previous posts on this forum were about ISAPI_Rewrite 3, now you post in v2. It has different syntax. Please, confirm that you need ISAPI_Rewrite 2, not 3.
Regards
Andrew
- insideinside
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: Problem adding new rule
Dear friend forgive me for the inconvenience. But according to my hosting there installed version 2 and version 3 together.
I believe sse code below is for version 2 because many years ago that uses it:
We can do the following if you agree.
You could tell me how the above rule would be in version 3?
I believe sse code below is for version 2 because many years ago that uses it:
- Code: Select all
RewriteEngine on
RewriteRule n/(.*),(.*),(.*)--(.*)/ n.asp?c=$1&co=$2&id=$3&t=$4
RewriteRule n/(.*),(.*),(.*)--(.*) n.asp?c=$1&co=$2&id=$3&t=$4
We can do the following if you agree.
You could tell me how the above rule would be in version 3?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Problem adding new rule
Having both on the server is not a good ides. How would we know which one is actually doing the job.
The difference that we can use now is that ISAPI_Rewrite 2 uses httpd.ini. ISAPI_Rewrite 3 - httpd.conf and .htaccess.
LEts figure out which one you're using and stick to it.
Regards
Andrew
The difference that we can use now is that ISAPI_Rewrite 2 uses httpd.ini. ISAPI_Rewrite 3 - httpd.conf and .htaccess.
LEts figure out which one you're using and stick to it.
Regards
Andrew
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Problem adding new rule
If it's .htaccess, than it's ISAPI_Rewrite 3.
So lets try to make it nicer and more compact:
Make sure you don't use ISAPI_Rewrite 2.
Regards
Andrew
So lets try to make it nicer and more compact:
- Code: Select all
RewriteEngine on
RewriteRule ^n/([^,]*)\,([^,]*)\,([^--]*)--(.*)/?$ /n.asp?c=$1&co=$2&id=$3&t=$4 [NC,L]
RewriteRule ^nn/([^,]*)\,([^,]*)\,([^--]*)--(.*)/?$ /nn.asp?c=$1&co=$2&id=$3&t=$4 [NC,L]
RewriteRule ^s/(.*)/?$ /s.asp?s=$1[NC,L]
Make sure you don't use ISAPI_Rewrite 2.
Regards
Andrew
- insideinside
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: Problem adding new rule
Dear Andrew
Thank you for your help. Your code worked perfectly.
I just needed to give a space between between this: $1 (space) [NC, L]
Thanks!!!
Thank you for your help. Your code worked perfectly.
I just needed to give a space between between this: $1 (space) [NC, L]
- Code: Select all
RewriteRule ^s/(.*)/?$ /s.asp?s=$1 [NC,L]
Thanks!!!
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests