This particular rewrite breaks the page formatting

Topics: Developer Forum, User Forum
Dec 1, 2010 at 4:32 PM
Edited Dec 1, 2010 at 4:49 PM

I have a client who serves several domains from one website space. To serve the right webpage, the system looks to the requested domain to decide what set of pages to display.

For instance:

www.conklincarshutchinson.com  - redirects to

www.conklincarshutchinson.com/hutchinson/home - rewrites to

/index.asp?p=24&sg=vj6fxvpnixys8vkjk

For SEO purposes, the client would like to omit the second step, and have

www.conklincarshutchinson.com  - rewrite to

/index.asp?p=24&sg=vj6fxvpnixys8vkjk

I'm using this rule from the documentation:

 

RewriteCond  %{HTTP_HOST}  ^www\.conklincarshutchinson\.com$ [OR]
RewriteCond  %{HTTP_HOST}  ^conklincarshutchinson\.com$
RewriteRule  ^/(.*)$ /index.asp?p=24&sg=vj6fxvpnixys8vkjk [I,L]

 

which works except that linked CSS, javascript, and images are broken:

 

<script src="/includeFiles/prototype.js"></script> 
<script src="/includeFiles/scriptaculous/scriptaculous.js"></script>

<link rel="stylesheet" type="text/css" href="/wStylesheets/user.css" media="ALL" />

<img src="/wimages/hutch/sprites.jpg" />

 

How do I rewrite the rule so that the relative links as shown continue to work?

Example images of the issue:

With the rule in place: https://dl.dropbox.com/u/15999800/conklin-error.jpg

The page normally: http://dl.dropbox.com/u/15999800/conklin-no-error.jpg

Thanks!

 

p.s. it would be very helpful if pages like

http://cheeso.members.winisp.net/Iirf20Help/html/39dbb30e-2afd-4cb1-aaff-45497fe2cbe6.htm

were available from a list of links the way the glossary is.

 

Dec 3, 2010 at 4:30 PM

Anyone? Can't believe this stumped the community...

Dec 3, 2010 at 8:29 PM

OKAY. Found the answer to this one on my own, buried deep in another post.  It needs to read like this:

RewriteCond  %{HTTP_HOST}  ^conklincarshutchinson\.com$ [OR]
RewriteCond  %{HTTP_HOST}  ^www\.conklincarshutchinson\.com$
RewriteRule  ^(/)$ /index.asp?p=24&sg=vj6fxvpnixys8vkjk [I,L]

I'm sure there's a way to do it without the OR directive, but my brain is too tired to figure it out just now.

Coordinator
Dec 4, 2010 at 10:54 AM

your solution is fine.

regarding your ps question, at the bottom of every page in the IIRF documentation there is a link with the text "view TOC" - View Table-of-Contents.

image of IIRF doc page

Click it and you will see the main entry page of the IIRF documentation.

 

Dec 17, 2010 at 4:16 PM

RE: the TOC.

That wasn't exactly what I'm after. The Table of Contents merely displays the list of articles. What I would really love to see is, for instance, an easy link to display the documentation for

RedirectRule <url-pattern> <replacement-string> [<modifiers>]

without having to click on an index item in the TOC (like Configuring IIRF), scroll through the topic to (hopefully) find a hyperlink that finally gets me to the specifics on a particular command.

Coordinator
Dec 17, 2010 at 4:46 PM

Ah, yes, that would be convenient.  I tried setting up fixed names like that for the help content files, but the help generator I use (Sandcastle Helpfile Builder) doesn't like it. I forget exactly what the problem was, but when I set a fixed name the helpfile links did not work, in some way.  So I let the tool generate links for me, and they turn out to be obscure GUIDs, not practically usable.

sorry.