[users@httpd] This rewrite rule don't work - in htaccess (mod_rewrite)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

In my forum, I have a .htaccess file.

I want to add a variable in this case :
"showtopic" OR ("showtopic" AND "st") variables are present, I add this variable : "rfurl=original in the" URL.

Exemple :
http://www.my-domain.com/index.php?showtopic=22954
-------> (redirect to)
http://www.my-domain.com/index.php?showtopic=22954&rfurl=original

http://www.my-domain.com/index.php?showtopic=22954&st=90
-------> (redirect to)
http://www.my-domain.com/index.php?showtopic=22954&st=90&rfurl=original



But if there is also others variables, I don't add the new variable.

Exemple :
http://www.my-domain.com/index.php?showtopic=22954&view=getlastpost
http://www.my-domain.com/index.php?showtopic=22954&pid=457390&st=300&;
http://www.my-domain.com/index.php?showtopic=22954&view=getnewpost
http://www.my-domain.com/index.php?showtopic=22954&hl=blouclage
I do nothing ! (don't redirect)


I have this rule in my .htaccess file (in my forum directory)

RewriteCond %{QUERY_STRING} showtopic
RewriteCond %{QUERY_STRING} !rfurl
RewriteCond %{QUERY_STRING} !view
RewriteCond %{QUERY_STRING} !gopid
RewriteCond %{QUERY_STRING} !showforum
RewriteCond %{QUERY_STRING} !pid
RewriteCond %{QUERY_STRING} !hl
RewriteRule index\.php index.php?rfurl=original[QSA,L,R]


But when I use this rule for exemple :
http://www.my-domain.com/index.php?showtopic=showtopic=61095

It don't redirect to :
http://www.my-domain.com/index.php?showtopic=showtopic=61095&rfurl=original

Because it says : "initial URL equal rewritten URL"

Look my log file :

559575:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (3) [per-dir /home/my-domain/public_html/forum/] applying pattern 'index\.php' to uri 'index.php' 559576:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (4) RewriteCond: input='' pattern='!lofiversion' => matched 559577:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (4) RewriteCond: input='/forum/index.php' pattern='!lofiversion' => matched 559578:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (4) RewriteCond: input='showtopic=61095' pattern='showtopic' => matched 559579:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (4) RewriteCond: input='showtopic=61095' pattern='!rfurl' => matched 559580:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (4) RewriteCond: input='showtopic=61095' pattern='!view' => matched 559581:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (4) RewriteCond: input='showtopic=61095' pattern='!gopid' => matched 559582:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (4) RewriteCond: input='showtopic=61095' pattern='!showforum' => matched 559583:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (4) RewriteCond: input='showtopic=61095' pattern='!pid' => matched 559584:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (4) RewriteCond: input='showtopic=61095' pattern='!hl' => matched 559585:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (2) [per-dir /home/my-domain/public_html/forum/] rewrite index.php -> index.php?rfurl=original[QSA,L,R] 559586:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (3) split uri=index.php?rfurl=original[QSA,L,R] -> uri=index.php, args=rfurl=original[QSA,L,R] 559587:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (3) [per-dir /home/my-domain/public_html/forum/] add per-dir prefix: index.php -> /home/my-domain/public_html/forum/index.php 559588:MY-IP - - [27/Mar/2006:02:31:43 --0600] [www.my-domain.com/sid#a067028][rid#a296fc8/initial] (1) [per-dir /home/my-domain/public_html/forum/] initial URL equal rewritten URL: /home/my-domain/public_html/forum/index.php [IGNORING REWRITE]



Have you an idea ?

Best regards
IU

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux