Alex wrote:
> Can a rewrite rule or something be used so that if
> <a style='text-decoration: underline;' href="http://www.indigoclothing.com" target="_blank">www.indigoclothing.com</a> is typed in, the user is taken to my dynamic
> page but as far as Google is concerned it does not look like a dynamic
> url?
We had a similar problem in our company, and couldn't use the standard
approaches because of the loading order of mod_rewrite and mod_jk (we rely
on mod_jk being first). We eventually write a RewriteMap which actually
creates the "static-looking" links on the fly by decoding the dynamic
links. The static content is simply a one-line stub file which looks
something like:
<!--#include
virtual="/webappname/doDeliverPage.do?template=$tmpl&cpid=$cpname&layout=$layout"
-->
(the vars are replaced by the perl-powered RewriteMap)
(http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=226784;sb=post_latest_reply;so=ASC;forum_view=forum_view_collapsed;;page=unread#unread)
> recommended using:
>
> RewriteRule ^/$ /cgi-bin/page.cgi?d=1&page=homepage [PT]
AFAIK [P] won't work when the destination is the same server.
> Can anyone help?
i toyed for a long time with this and the only way i got working (again, due
to our requirements involving mod_jk) was to use mod_rewrite to actually
create content, instead of simply rewriting.
Example:
User goes to:
<a style='text-decoration: underline;' href="http://foo.com/dynamic_looking_link.html" target="_blank">http://foo.com/dynamic_looking_link.html</a>
Rewrite passed that to our RewriteMap, which then creates a dummy file (if
it doesn't exist) which does a "virtual" import of:
/real/path/to/my/content?foo=bar&one=two
The user still sees the static-looking URL. We use paths to denote
parameters to be passed via the dummy page:
<a style='text-decoration: underline;' href="http://foo.com/appname/somearg/anotherarg" target="_blank">http://foo.com/appname/somearg/anotherarg</a>
which would then be translated into the file:
<docroot>/appname/somearg/anotherarg/index.shtml
which contains
something like:
<!--#include
virtual="/webappname/doDeliverPage.do?arg1=somearg&arg2=anotherarg" -->
Note that the RewriteMap does NOT actually rewrite anything! Instead it
generates the content the user thinks he asked for.
--
----- stephan beal
Registered Linux User #71917 <a style='text-decoration: underline;' href="http://counter.li.org" target="_blank">http://counter.li.org</a>
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: ReWrite Rules