Where is my error? RewriteCond or Rule?
6 posts
• Page 1 of 1
Where is my error? RewriteCond or Rule?
Can anyone help me?
Url is
http://www.mysite.com.br/eventos/informacao.asp?id=paula_fernandes_em_pocos_de_caldas_18052012
Result is
http://www.mysite.com.br/eventos/paula_fernandes_em_pocos_de_caldas_18052012?id=paula_fernandes_em_pocos_de_caldas_18052012
I need this
http://www.mysite.com.br/eventos/paula_fernandes_em_pocos_de_caldas_18052012
Can anyone give me a hint, already tried and tested several, but not working.
- Code: Select all
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=(.*)$ [NC]
RewriteRule ^eventos/informacao\.asp$ /eventos/%1 [NC,R=301,L]
Url is
http://www.mysite.com.br/eventos/informacao.asp?id=paula_fernandes_em_pocos_de_caldas_18052012
Result is
http://www.mysite.com.br/eventos/paula_fernandes_em_pocos_de_caldas_18052012?id=paula_fernandes_em_pocos_de_caldas_18052012
I need this
http://www.mysite.com.br/eventos/paula_fernandes_em_pocos_de_caldas_18052012
Can anyone give me a hint, already tried and tested several, but not working.
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Where is my error? RewriteCond or Rule?
Hello,
there's a tiny trick for this, you need to use '?' at the end of the rule to avoid appending querystring:
Regards
Andrew
there's a tiny trick for this, you need to use '?' at the end of the rule to avoid appending querystring:
- Code: Select all
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id=(.*)$ [NC]
RewriteRule ^eventos/informacao\.asp$ /eventos/%1? [NC,R=301,L]
Regards
Andrew
Re: Where is my error? RewriteCond or Rule?
ran the url was written
http://www.mysite.com.br/eventos/paula_fernandes_em_pocos_de_caldas_18052012
the problem is found the page
The system can not find the file specified.
have any tips on that?
http://www.mysite.com.br/eventos/paula_fernandes_em_pocos_de_caldas_18052012
the problem is found the page
The system can not find the file specified.
have any tips on that?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Where is my error? RewriteCond or Rule?
Well, you wanted a redirect. the rule works fine you get redirected.
Maybe now you need a rewrite rule to load the content for SEO friendly URL?
Regards
Andrew
Maybe now you need a rewrite rule to load the content for SEO friendly URL?
Regards
Andrew
Re: Where is my error? RewriteCond or Rule?
I found after much research, a provisional solution.
She is working but not as I wanted.
I had to rename Eventos to Evento
As I had to do for him to apply this rule, only the file informacao.asp?
I think it is something in this part ([^/]+)$
This is my code that should work
Could someone help me with this? Please.
She is working but not as I wanted.
I had to rename Eventos to Evento
As I had to do for him to apply this rule, only the file informacao.asp?
- Code: Select all
RewriteCond %{QUERY_STRING} ^id=(.*)$ [NC]
RewriteRule ^eventos/informacao\.asp$ /evento/%1? [NC,R=301,L]
RewriteRule ^evento/([^/]+)$ /eventos/informacao.asp?id=$1 [NC,L]
I think it is something in this part ([^/]+)$
This is my code that should work
- Code: Select all
RewriteCond %{QUERY_STRING} ^id=(.*)$ [NC]
RewriteRule ^eventos/informacao\.asp$ /eventos/%1? [NC,R=301,L]
RewriteRule ^eventos/([^/]+)$ /eventos/informacao.asp?id=$1 [NC,L]
Could someone help me with this? Please.
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests