Thanks Andy! I'll give it a try and report back.
Jan 19, 2004, 11:09 AM
Veteran / Moderator (6956 posts)
Jan 19, 2004, 11:09 AM
Post #52 of 111
Views: 14575
Alex gave me this solution in a discussion awhile back:
Links SQL can do search engine friendly URL's quite easily.
Simply create a directory in www called say 'portal', and then put an .htaccess there with:
RewriteEngine On
RewriteRule (.*) /cgi-bin/links/page.cgi?g=1 [L]
then in your admin area, set the url's to http://domain/portal.
I haven't tested this, but I know GT has given search engine friendliness a lot of thought over the years.
This is similar to andy's suggestion, just a different logic.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote:
Links SQL can do search engine friendly URL's quite easily.
Simply create a directory in www called say 'portal', and then put an .htaccess there with:
RewriteEngine On
RewriteRule (.*) /cgi-bin/links/page.cgi?g=1 [L]
then in your admin area, set the url's to http://domain/portal.
I haven't tested this, but I know GT has given search engine friendliness a lot of thought over the years.
This is similar to andy's suggestion, just a different logic.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Jan 20, 2004, 1:51 AM
Novice (49 posts)
Jan 20, 2004, 1:51 AM
Post #53 of 111
Views: 14418
Thanks for your responses Andy and PugDog.
Unfortunately, I think I am doing something wrong, possibly the global entry - I tried to adapt the code that Ivan posted, but I don't think I got it right. Any assistance or insight anyone can offer is greatly appreciated.
ATKOgirl
Unfortunately, I think I am doing something wrong, possibly the global entry - I tried to adapt the code that Ivan posted, but I don't think I got it right. Any assistance or insight anyone can offer is greatly appreciated.
ATKOgirl
Feb 13, 2004, 1:46 PM
User (167 posts)
Feb 13, 2004, 1:46 PM
Post #54 of 111
Views: 14492
This is a great addtion to Links SQL and it works fantastic but I have a question.
What do I need to do to change the way the url looks here
http://www.mysite.com/...n_Museum_Works_L606/
to just the url with the title?
http://www.mysite.com/...anklin_Museum_Works/
Thanks,
Craven
What do I need to do to change the way the url looks here
http://www.mysite.com/...n_Museum_Works_L606/
to just the url with the title?
http://www.mysite.com/...anklin_Museum_Works/
Thanks,
Craven
Mar 28, 2004, 12:00 PM
User (69 posts)
Mar 28, 2004, 12:00 PM
Post #55 of 111
Views: 14318
Hi, I have been trying to figure out the rewrite rules. This seems to be where I am having problems. I have added the global "rewrite_url". This seems to work fine. I am forcing the link to be Detailed/title.shtml. This is how I would like the link to be if possible instead of Detailed/title_id.shtml. What I can't seem to do is get the detailed pages to actually build this way. They still build as Detailed/id.shtml.
I have tried adding this RewriteRule to my .htaccess in the admin folder of the linksql I have installed. The same one the points to the .htpasswd file.
RewriteEngine On
RewriteRule ^.*L([0-9]+).*\.shtml$ \/Movies/Detailed\/$1\.shtml [L]
I have tried various forms of this rule, but all I get are errors (internal server error & Forbidden)
The Global I am using is:
sub {
my $ID = shift;
my $Title = shift;
$Title =~ y/ \t\r\n?"'#/__/d;
return $CFG->{build_detail_url} . '/' . $Title . '.shtml';
}
Help please. . .
I have tried adding this RewriteRule to my .htaccess in the admin folder of the linksql I have installed. The same one the points to the .htpasswd file.
RewriteEngine On
RewriteRule ^.*L([0-9]+).*\.shtml$ \/Movies/Detailed\/$1\.shtml [L]
I have tried various forms of this rule, but all I get are errors (internal server error & Forbidden)
The Global I am using is:
sub {
my $ID = shift;
my $Title = shift;
$Title =~ y/ \t\r\n?"'#/__/d;
return $CFG->{build_detail_url} . '/' . $Title . '.shtml';
}
Help please. . .
Mar 29, 2004, 12:25 PM
Veteran / Moderator (6956 posts)
Mar 29, 2004, 12:25 PM
Post #56 of 111
Views: 14290
Quote:
What do I need to do to change the way the url looks here http://www.mysite.com/Cool_Places/B/Bigeddise/Business_and_Economy/Financial_Services/Buford_Franklin_Museum_Works_L606/
to just the url with the title?
http://www.mysite.com/Buford_Franklin_Museum_Works/
I don't think you can. The reason is that the title of the link, is not used as an index/key in the database. The rewrite rules work for categories, because the full-name of the category is what is passed to the g= parameter.
The same isn't true with a link. What is passed is the ID.
The original post used the _L flag to mark the beginning of the ID field. Any digits immediately following that flag were taken to be the ID (unique identifier of the link).
What's happening with the rewrite rules, is people see a small improvement, and they want everything ;) CGI is stateless, so you have to pass back EVERYTHING you want the server to do, inside the URL string, _or_ you have to use high-overhead session IDs, cookies, and other magic to record _probably_ where the is/was and wants to go.
To do what you want, you'd have to rewrite a few of the internal routines to recognize the passed in long string as a detailed name in lieu of an ID (not incredibly hard) and then you'd need to construct an index on the Title of the links, for performance, and debug a few things.
It's not trivial, but I'm not sure it can be done with rewrite rules. And, it might not work in every case, since most likely some rule sets would have to be created for deciding what is or is not a passed in "Title". You might have to use a rewrite rule to pick off .html page requests, and if they contain only a single '/' in the path, and end in .html assume that everything from the last / to the .html is the "Title" of the link, and search for it by passing it to a modified detail_page.cgi or jump.cgi
Not trivial, but potentially possible.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Apr 8, 2004, 5:44 AM
User (238 posts)
Apr 8, 2004, 5:44 AM
Post #57 of 111
Views: 14213
Can you help - I'm trying to implement this for my detailed pages:
Have I made any obvious mistakes??
Read the thread & I tried to do this, using the info from the thread….:
I can see some of it working - BUT it doesn’t work completely…..
The links do not go to their detailed pages – they go to ErrorDocument 404
I can see the url appears to be formed for the link when I hover my “mouse” over the title of the link
I tried this on a "practice" site (this is where I “practice” – so that I don’t mess up my real site....)
Link.html:-- added: <a href="<%rewrite_url($ID,$Title)%>"><%Title%></a>
(first I forgot to remove this line…. so I had 2 title links for each vacancy!!!!)
<a class="link" href="<%detailed_url%>"><%Title%></a>
I removed <a class="link" href="<%detailed_url%>"><%Title%></a> from link.html
New Global: rewrite_url
sub {
my $ID = shift;
my $Title = shift;
my $cats = $DB->table('Links')->get_categories($ID);
my ($cat_id,$cat_full_name) = each %$cats;
my $cat_url = $DB->table('Category')->as_url($cat_full_name);
$Title =~ y/ \t\r\n?"'#/__/d;
return '/' . $cat_url . '/' . $Title . '_L' . $ID . '/';
}
RewriteRule ^.*L([0-9]+)/?$ /Some-thing/$1.html [L]
I had previously renamed the "Detailed" to read Some-thing (more appropriate for my site subject)
NOTE: I also have this: ErrorDocument 404 http://.......redirect.....url... in the htaccess file
Colin Thompson
Have I made any obvious mistakes??
Read the thread & I tried to do this, using the info from the thread….:
I can see some of it working - BUT it doesn’t work completely…..
The links do not go to their detailed pages – they go to ErrorDocument 404
I can see the url appears to be formed for the link when I hover my “mouse” over the title of the link
I tried this on a "practice" site (this is where I “practice” – so that I don’t mess up my real site....)
Link.html:-- added: <a href="<%rewrite_url($ID,$Title)%>"><%Title%></a>
(first I forgot to remove this line…. so I had 2 title links for each vacancy!!!!)
<a class="link" href="<%detailed_url%>"><%Title%></a>
I removed <a class="link" href="<%detailed_url%>"><%Title%></a> from link.html
New Global: rewrite_url
sub {
my $ID = shift;
my $Title = shift;
my $cats = $DB->table('Links')->get_categories($ID);
my ($cat_id,$cat_full_name) = each %$cats;
my $cat_url = $DB->table('Category')->as_url($cat_full_name);
$Title =~ y/ \t\r\n?"'#/__/d;
return '/' . $cat_url . '/' . $Title . '_L' . $ID . '/';
}
RewriteRule ^.*L([0-9]+)/?$ /Some-thing/$1.html [L]
I had previously renamed the "Detailed" to read Some-thing (more appropriate for my site subject)
NOTE: I also have this: ErrorDocument 404 http://.......redirect.....url... in the htaccess file
Colin Thompson
Apr 19, 2004, 10:09 AM
User (107 posts)
Apr 19, 2004, 10:09 AM
Post #59 of 111
Views: 14297
i'm having a few problems with this need help.
i set up the .htaccess file in my root dir
RewriteEngine On
RewriteRule ^.*L([0-9]+)/?$ \/sql212\/page.cgi?g=Detailed\/$1\.shtml [L]
I replaced the url in the links.html to
<a href="<%rewrite_url($ID,$Title)%>"><%Title%></a>
and i added the exact global
sub { my $ID = shift; my $Title = shift; my $cats = $DB->table('Links')->get_categories($ID); my ($cat_id,$cat_full_name) = each %$cats; my $cat_url = $DB->table('Category')->as_url($cat_full_name); $Title =~ y/ \t\r\n?"'#/__/d; return '/' . $cat_url . '/' . $Title . '_L' . $ID . '/'; }
when i have build detailed turned on i get normal detail links
when i have it turned off i get
http://mysite.com/...ag:%20'detailed_url'
I'm not sure where the problem is. I have tried different variations of the rewrite htaccess from this post without any luck. I have changed the original setup url extension to .shtml
htaccess is in my root file with the Detailed directory
i set up the .htaccess file in my root dir
RewriteEngine On
RewriteRule ^.*L([0-9]+)/?$ \/sql212\/page.cgi?g=Detailed\/$1\.shtml [L]
I replaced the url in the links.html to
<a href="<%rewrite_url($ID,$Title)%>"><%Title%></a>
and i added the exact global
sub { my $ID = shift; my $Title = shift; my $cats = $DB->table('Links')->get_categories($ID); my ($cat_id,$cat_full_name) = each %$cats; my $cat_url = $DB->table('Category')->as_url($cat_full_name); $Title =~ y/ \t\r\n?"'#/__/d; return '/' . $cat_url . '/' . $Title . '_L' . $ID . '/'; }
when i have build detailed turned on i get normal detail links
when i have it turned off i get
http://mysite.com/...ag:%20'detailed_url'
I'm not sure where the problem is. I have tried different variations of the rewrite htaccess from this post without any luck. I have changed the original setup url extension to .shtml
htaccess is in my root file with the Detailed directory
Apr 19, 2004, 10:33 AM
Veteran (1921 posts)
Apr 19, 2004, 10:33 AM
Post #60 of 111
Views: 14275
That rewrite rule won't work unless you have detail pages turned on. If you want to use dynamic detailed pages you need to use Pugdog's plugin. Then you can use this rule (assuming the cgi script is called detail_page.cgi):
RewriteRule ^.*L([0-9]+)/?$ /sql212/detail_page.cgi?ID=$1 [L]
RewriteRule ^.*L([0-9]+)/?$ /sql212/detail_page.cgi?ID=$1 [L]
Apr 19, 2004, 11:05 AM
User (107 posts)
Apr 19, 2004, 11:05 AM
Post #62 of 111
Views: 14292
Hello,
I do have build detail turned on. I was only turning it on and off to locate the problem.
I changed the rewrite to
RewriteRule ^.*L([0-9]+)/?$ /sql212/page.cgi?ID=$1 [L]
and that did not work either it seems to keep going back to Detailed/9055.shtml or other link numbers
this is tuff
I do have build detail turned on. I was only turning it on and off to locate the problem.
I changed the rewrite to
RewriteRule ^.*L([0-9]+)/?$ /sql212/page.cgi?ID=$1 [L]
and that did not work either it seems to keep going back to Detailed/9055.shtml or other link numbers
this is tuff

Apr 19, 2004, 11:19 AM
User (107 posts)
Apr 19, 2004, 11:19 AM
Post #64 of 111
Views: 14264
When I have detailed build turned off it looks like the nice url is displayed on the links.html correctly except for the detail page id tag. http://mysite.com/...ag:%20'detailed_url'
When I turn build on, the link on the link.html looks like the normal detailed/1111.shtml
I'm not sure why the nice url does not display correctly and work when I turn build detailed on.
after each change i make i build all the database, not sure if this is necessary.
When I turn build on, the link on the link.html looks like the normal detailed/1111.shtml
I'm not sure why the nice url does not display correctly and work when I turn build detailed on.
after each change i make i build all the database, not sure if this is necessary.
Apr 19, 2004, 11:25 AM
Veteran (1921 posts)
Apr 19, 2004, 11:25 AM
Post #65 of 111
Views: 14174
OK - I think I understand.
It sounds like you are still using <%detailed_url%> in the template rather than <%rewrite_url($ID,$Title)%>. This would lead to the exact problem you describe.
You shouldn't need to build to see what is going on - just view the site dynamically.
It sounds like you are still using <%detailed_url%> in the template rather than <%rewrite_url($ID,$Title)%>. This would lead to the exact problem you describe.
You shouldn't need to build to see what is going on - just view the site dynamically.
Apr 19, 2004, 11:53 AM
Veteran (1921 posts)
Apr 19, 2004, 11:53 AM
Post #70 of 111
Views: 14238
When it says File does not exist - does it? I assume that you now have the correct url in the Links template and it is getting rewritten correctly. So the problem must be with the url that it is getting rewritten to?
If you type http://www.yoursite.com/...i?g=Detailed/1.shtml where 1 is the number of a link in your directory into your browser - does this work? Are you maybe missing cgi-bin from the path?
If you type http://www.yoursite.com/...i?g=Detailed/1.shtml where 1 is the number of a link in your directory into your browser - does this work? Are you maybe missing cgi-bin from the path?
Apr 19, 2004, 12:03 PM
User (107 posts)
Apr 19, 2004, 12:03 PM
Post #73 of 111
Views: 14186
yes it was.
i put .shtml in the global were the / was at the end
i changed it back $ID . '/'; }
sub { my $ID = shift; my $Title = shift; my $cats = $DB->table('Links')->get_categories($ID); my ($cat_id,$cat_full_name) = each %$cats; my $cat_url = $DB->table('Category')->as_url($cat_full_name); $Title =~ y/ \t\r\n?"'#/__/d; return '/' . $cat_url . '/' . $Title . '_L' . $ID . '/'; }
it still does the same thing. it does not seem to find the detailed page
i put .shtml in the global were the / was at the end
i changed it back $ID . '/'; }
sub { my $ID = shift; my $Title = shift; my $cats = $DB->table('Links')->get_categories($ID); my ($cat_id,$cat_full_name) = each %$cats; my $cat_url = $DB->table('Category')->as_url($cat_full_name); $Title =~ y/ \t\r\n?"'#/__/d; return '/' . $cat_url . '/' . $Title . '_L' . $ID . '/'; }
it still does the same thing. it does not seem to find the detailed page
Apr 19, 2004, 12:08 PM
Veteran (1921 posts)
Apr 19, 2004, 12:08 PM
Post #74 of 111
Views: 14223
This would be so much easier if I had access to your site
.
Can you try typing this into your browser to test your rewrite rule:
http://www.yoursite.com/_L8793

Can you try typing this into your browser to test your rewrite rule:
http://www.yoursite.com/_L8793