Forum Moderators: phranque

Message Too Old, No Replies

How many hyphens can you get in a 301 please?

         

Dexie

4:37 pm on Sep 11, 2005 (gmt 0)

10+ Year Member



Does anyone know if there is a limit to how many hyphens you can use in a 301 redirect please?

I have this in my .htaccess, but can't seem to get it to work - is there another way of coding it at all?

RewriteRule ^word-word-word-word-word-word-word-word/?$ http://www.example.com/word-word-word-word-word-word-word-word/[R=301,L]

I know its unusual to have so many words and hyphens in a URL, but there's a history to it.

Any help much appreciated.

Dexie.

[edited by: jdMorgan at 4:58 pm (utc) on Sep. 11, 2005]
[edit reason] Example.com [/edit]

jdMorgan

4:57 pm on Sep 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I doubt that the problem is due to the hyphens -- they're treated just like any other character.

However, you are missing a space between the substitution URL and the flags:


RewriteRule ^word-word-word-word-word-word-word-word/?$ http://www.example.com/word-word-word-word-word-word-word-[b]word/ [R=301,L][/b]

Jim

Dexie

7:10 am on Sep 12, 2005 (gmt 0)

10+ Year Member



I can't believe it Jim, I've been trying to work this one out for many hours and for the life of me, I didn't spot that gap grrrrr!

Many thanks for your quick response with the solution Jim and sorry 'bout the website name.

I do have another Apache question, but will start another thread.

Dexie.