You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ghalem Ouadjed <ga...@gmail.com> on 2019/06/27 08:45:51 UTC

[users@httpd] Rewriting

Hello, at this day i didn t find the answer to the following question :

RewriteRule ^that-and-that$  talent\.php\?id=(.+)[E=BREAK:1,L]
RewriteCond     %{ENV:REDIRECT_BREAK}     !^1$
RewriteCond     %{QUERY_STRING}   ^id=([0-9]+)$ [NC]

RewriteRule ^this\.php$ /that-and-that [QSD,R=301,L]

This code works actually but it doesn t display the right product. I found
my php var_dump display this info ...["QUERY_STRING"]=> string(20)
"id=(.+)[E=BREAK:1,L]. ... and my http header tells me that the 301 works
good and the url /that-and-that works too.

I would like to precise that even if i had a /$1 after my rewriting url, i
can t get the right product description.

I have to build this htaccess because each product description is in a one
page so this is a duplicate content. My aim is to declare /that-and-that as
the canonical page for my product descriptions.

Thank you very much in advance for your time.
Ghalem

Membre-Fondateur et Trésorier de l'ANEÏST - aneist.com
{Association Nationale des Entreprises Innovantes Industrielles
Scientifiques et Technologiques}

Re: [users@httpd] Rewriting

Posted by Ghalem Ouadjed <ga...@gmail.com>.
That s an idea Frank thank you. I try it and come right back.




Membre-Fondateur et Trésorier de l'ANEÏST
{Association Nationale des Entreprises Innovantes Industrielles
Scientifiques et Technologiques}


Le jeu. 27 juin 2019 à 13:55, Frank <th...@apache.org> a écrit :

> I would use the rewrite log to debug, as a starting point. There are
> many external factors that could influence (or derail) this scenario.
>
> On 27/06/19 04:45 AM, Ghalem Ouadjed wrote:
> > Hello, at this day i didn t find the answer to the following question :
> >
> > RewriteRule ^that-and-that$  talent\.php\?id=(.+)[E=BREAK:1,L]
> > RewriteCond     %{ENV:REDIRECT_BREAK}     !^1$
> > RewriteCond     %{QUERY_STRING}   ^id=([0-9]+)$ [NC]
> >
> > RewriteRule ^this\.php$ /that-and-that [QSD,R=301,L]
> >
> > This code works actually but it doesn t display the right product. I
> > found my php var_dump display this info ...["QUERY_STRING"]=> string(20)
> > "id=(.+)[E=BREAK:1,L]. ... and my http header tells me that the 301
> > works good and the url /that-and-thatworks too.
> >
> > I would like to precise that even if i had a /$1 after my rewriting url,
> > i can t get the right product description.
> >
> > I have to build this htaccess because each product description is in a
> > one page so this is a duplicate content. My aim is to declare
> > /that-and-that as the canonical page for my product descriptions.
> >
> > Thank you very much in advance for your time.
> > Ghalem
> >
> > Membre-Fondateur et Trésorier de l'ANEÏST - aneist.com <
> http://aneist.com>
> > {Association Nationale des Entreprises Innovantes Industrielles
> > Scientifiques et Technologiques}
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Rewriting

Posted by Frank <th...@apache.org>.
I would use the rewrite log to debug, as a starting point. There are
many external factors that could influence (or derail) this scenario.

On 27/06/19 04:45 AM, Ghalem Ouadjed wrote:
> Hello, at this day i didn t find the answer to the following question :
> 
> RewriteRule ^that-and-that$  talent\.php\?id=(.+)[E=BREAK:1,L]
> RewriteCond     %{ENV:REDIRECT_BREAK}     !^1$
> RewriteCond     %{QUERY_STRING}   ^id=([0-9]+)$ [NC] 
> 
> RewriteRule ^this\.php$ /that-and-that [QSD,R=301,L]
> 
> This code works actually but it doesn t display the right product. I
> found my php var_dump display this info ...["QUERY_STRING"]=> string(20)
> "id=(.+)[E=BREAK:1,L]. ... and my http header tells me that the 301
> works good and the url /that-and-thatworks too.
> 
> I would like to precise that even if i had a /$1 after my rewriting url,
> i can t get the right product description.
> 
> I have to build this htaccess because each product description is in a
> one page so this is a duplicate content. My aim is to declare
> /that-and-that as the canonical page for my product descriptions.
> 
> Thank you very much in advance for your time.
> Ghalem
> 
> Membre-Fondateur et Trésorier de l'ANEÏST - aneist.com <http://aneist.com>
> {Association Nationale des Entreprises Innovantes Industrielles
> Scientifiques et Technologiques}
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org