Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Static + Dynamic Combination

Quote Reply
Static + Dynamic Combination
I ran into a little problem non GLinks URL's being converted into dynamic ones and was wondering if anyone had a work-around it.

For example
Static View : http://www.webhostingkit.com/
Dynamic View : http://www.webhostingkit.com/a/cgi/page.cgi?d=1

In the top menu "Contact" link, left of "My Account" is non GLink content page (made via frontpage and uploaded via ftp). Now the problem is, when the site is viewed in dynamic mode, and if user clicks on "Contact us' page, it gives page not found error. So is there any way, where if non glinks urls are inserted in the template, it will preserve them?

Any suggestions would be appreciated.

Thank you.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Static + Dynamic Combination In reply to
There are two methods I've found.

1. is to set the url to that page to be relative. so instead of an absolute href=http://www.webhostingkit.com/Contact;
try: href=/Contact/

2. or (if you're domain supports it, remove the www):
href=http://webhostingkit.com/Contact

Neither one of these should match your build_root_url value.

Hope that helps.

peace.
Quote Reply
Re: [klangan] Static + Dynamic Combination In reply to
The first one is the better solution :)

<a href="/c/contact">contact</a>

Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static + Dynamic Combination In reply to
How can I set url to relative for 4 to 5 lvl deep category & sub category structure.

Suppose if I set it to /c/contact/ then for the 3rd lvl category it has to be different and for the 4th lvl category the relative url has to be different.

Any thoughts?

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Static + Dynamic Combination In reply to
Hi Vishal,

Why don't you just hard code the contact page ? Is there a reason to have it like that rather than use a mod_rewrite that would redirect to the contact page.

For example :
RewriteRule ^/contact/?$ /cgi/page.cgi?p=contact.html [L,PT]

and then you would just code in http://www.webhostingkit.com/contact

Cheers, John
Significant Media
Quote Reply
Re: [Jag] Static + Dynamic Combination In reply to
This contact page is actually an example of the problem. I did thought of just setting up another template in Glinks and calling it via p=pagename, however at Software Devil, there are going to be quite a few pages that made outside of GLinks but will still be a part of site navigation. At this time I only got few options (1) Setup sub domain and have all non Glinks pages there, (2) Use GLinks for all the content stuff, (but that makes work more complicated, (3) Use klangan's suggestion of having non-glinks pages without "www" in the URL. Unless there is another solution, I am thinking that # 3 might be the easiest one to implement. (just hate it, as many a times a URL with and without www can be interpreted by SE's as different url.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Static + Dynamic Combination In reply to
Hi Vishal,

Do all the pages you want to manage have something in common can't you put them in folder that is ignored by mod_rewrite and then you can just modify them as static pages.

Ex :
http://www.domain.com/site/contact
http://www.domain.com/site/legal

etc.

I'm not sure I have understood the need to separate them from the site.

John
Significant Media
Quote Reply
Re: [SWDevil.Com] Static + Dynamic Combination In reply to
In Reply To:
How can I set url to relative for 4 to 5 lvl deep category & sub category structure.

Suppose if I set it to /c/contact/ then for the 3rd lvl category it has to be different and for the 4th lvl category the relative url has to be different.

You trying to say that if they were in /Testing_Cat/Something/, and clicked the link - it would go to /Testing_Cat/Something/c/contact ?

If so, thats not gonna be the case =)

Having c/contact would do that, but specifiying the / before / means it will set the base URL as your main domain :)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Jag] Static + Dynamic Combination In reply to
Jag,

Would have to be this =) (note the missing .html :P)

RewriteRule ^/contact/?$ /cgi/page.cgi?p=contact [L,PT]

Otherwise it'll give an error about contact.html.html not existing <G>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [SWDevil.Com] Static + Dynamic Combination In reply to
Vishal,

Sorry as Andy pointed out I got two rewrite rules mixed up.

This is the one I use in general :

RewriteRule ^/(.*).html$ /cgi-bin/page.cgi?p=$1 [L,PT]

You can then call :

www.domain.com/contact.html

which is forwarded to :

www.domain.com/cgi-bin/page.cgi?p=contact

I use it for any pages that are not actually part of the Links general pages which seems to be similar to you initial request. The main advantage is that you can have the overall template design and then add the content you want by includes, thus enabling any site wide changes to filter down to these pages.

The above set-up requires you to change the build_root_url, but I find it looks better than having to use directories to hide files in. Otherwise you could also have an extra 'directory' to fit what you have discussed above like :

RewriteRule ^/c/(.*).html$ /cgi-bin/page.cgi?p=$1 [L,PT]
for :
www.domain.com/c/contact.html

Cheers

John
Significant Media

Last edited by:

Jag: Jun 20, 2006, 8:06 AM
Quote Reply
Re: [Jag] Static + Dynamic Combination In reply to
Hi Andy & Jag, thanks for trying out with the rewrite rule, however neither one seemed to help.

I tried below rules:
  • RewriteRule ^/contact/?$ /cgi/page.cgi?p=contact [L,PT]
  • RewriteRule ^/c/(.*).html$ /cgi-bin/page.cgi?p=$1 [L,PT]

After inserting above line in .htaccess I accessed the site via dynamic mode and clicked on 'Contact' link from top menu. However both of them gave the same error.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Static + Dynamic Combination In reply to
Hi Vishal,

When I try http://www.webhostingkit.com/c/contact/

I get to a contact page. I you saying that it doesn't work as a link or that it doesn't work in the dynamic pages ?

What link are you coding into the template ?

Try replacing the [R,L] if you want to see where the mod_rewrite is actually redirecting then when you get the right setting you can move back to a pass through like in the above example.

John
Significant Media
Quote Reply
Re: [Andy] Static + Dynamic Combination In reply to
In Reply To:
In Reply To:
How can I set url to relative for 4 to 5 lvl deep category & sub category structure.

Suppose if I set it to /c/contact/ then for the 3rd lvl category it has to be different and for the 4th lvl category the relative url has to be different.


You trying to say that if they were in /Testing_Cat/Something/, and clicked the link - it would go to /Testing_Cat/Something/c/contact ?

If so, thats not gonna be the case =)

Having c/contact would do that, but specifiying the / before / means it will set the base URL as your main domain :)



Thanks Andy, Oh.. Wow. that is a simple solution.. and it did worked too.. All what is needed was "/"..

Thank you all for the help.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [Jag] Static + Dynamic Combination In reply to
Hi John,

Sorry if my post didn't included proper information.

What I tried was used the above rewrite line in .htaccess file and viewed site dynamic mode & then clicked on 'contact' link from top menu & what I got was http://www.webhostingkit.com/...g=c%2Fcontact%2F;d=1

I hope one of these days I will readup on mod rewrite.. it should come in handy a lot.

P.S. for now it seems like as Andy suggested adding "/" seems the best idea, as it does not require .htaccess use and hence little less load on server too.

Thanks again for the quick response & in your interest for helping me, I appreciate it.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Static + Dynamic Combination In reply to
No problem =) (I speak from bitter experience with the same problem <G>) I can also see it from GT's side of things too - i.e if they didn't rewrite the URL's, then the whole dynamic system wouldn't work either =)

Anyway, glad it worked =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!