Forum Moderators: phranque

Message Too Old, No Replies

RedirectMatch issue

redirectmatch

         

tintin74

5:06 pm on Sep 21, 2007 (gmt 0)

10+ Year Member



Hello, I need some help from some apache experts.

I need to make some "RedirectMatch 301" from this kind of url:

[domain.com...]

to this other one:

[domain.com...]

where "title-of-the-page" and "1234" are variable and "1234" is always a number.

It a sort of inverse rewrite, I know it's a strange thing but I need to redirect the static urls to the old dinamics.

I hope someone could help me please.

Thank you in advance

Tintin

jdMorgan

10:53 pm on Sep 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I haven't done this with RedirectMatch before, so this may need some tweaking, or it may not work at all:

RedirectMatch 301 /(([^-]-)*vt([0-9]+)\.html) http://www.example.com/viewtopic.php?t=$3

Before using this code, though, ask yourself which of the following are true:
1) I need a redirect to replace the search0engine friendly static URLs with the dynamic ones.
2) I need an internal redirect so that a request for a static URL is served content from the "viewtopic" script.

It is common for Webmasters to mix-up external redirects and internal rewrites, and this mix-up can be dangerous to your search ranking, traffic, and revenue.

Jim

g1smd

7:34 pm on Sep 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Those look like the "Search Engine Friendly URLs" that some forums implement.

In that case, the URLs on the page should be those with the keywords, and when those URLs are requested it is then an internal rewrite that fetches the content from the dynamic-parameter-styled internal filepath.

However, you also need to block all direct access to the dynamic URLs as they will be considered as being Duplicate Content.