Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: .htaccess Doctor? I'm sick.  (Read 989 times)

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
.htaccess Doctor? I'm sick.
« on: January 20, 2010, 12:16:42 pm »

 :(
Hello hello

I'm getting mad with an .htaccess issue.

Let me explain.
Some blogs using WP are fucking my links in the comments.
EG:
-http://myblog.fr/mycat/mylink/)

Doing a simple 301 gives such a redirection (which is another page]
-http://myblog.fr/mycat/mylink/)?category=mycat/mylink/)

For SEO reasons I'ld like to have such a redirection (to the good page)
Code: [Select]
RewriteRule ^mycat/mylink/)$ http://myblog.fr/mycat/mylink/ [R=301,L]
But it doesn't work at all.
Is there a previous rule from the orginal sNews .htacces file which blocks it and generate this )?category= URI?
 :'(

skian

  • Full Member
  • ***
  • Karma: 14
  • Posts: 120
Re: .htaccess Doctor? I'm sick.
« Reply #1 on: January 20, 2010, 06:02:50 pm »

")" should be escaped, so :

Code: [Select]
RewriteRule ^mycat/mylink/\)$ http://myblog.fr/mycat/mylink/ [R=301,L]
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: .htaccess Doctor? I'm sick.
« Reply #2 on: January 21, 2010, 09:25:00 am »

Thanks for your reply skian.
I've tried (an other) that too but it leads to a 404. :P

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: .htaccess Doctor? I'm sick.
« Reply #3 on: January 21, 2010, 12:16:11 pm »

Okey found it.
Your rule was right.
But it had to placed at the top of the rules like this:
Code: [Select]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^mycat/mylink/\)$ http://myblog.fr/mycat/mylink/ [R=301,L]
Shame on me! I didn't remember I already had this issue in an other snnozer's life (1.6)
Thanks again skian.