I've make a small sef module to make links 2.0 more Search Engine Firiendly, the module user Mod_Rewrite do modify the url from:
http://www.sitename.com/...ory/subcat2/subcat3/
to
http://www.sitename.com/...ategory-category.htm
You can see the mod morking here: www.travelstarthere.com
Here how to implement this mod:
Edit links.cfg
find: # URL of User CGI directory. No Trailing Slash.
up of this write:
###### Mod_Rewrite Option
###### Set to 1 enable the Mod_Rewrite
$mod_rewrite = 1;
now save this file and open site_html_template.pl
find and delete this line:
now write as follow:
if ($mod_rewrite eq 1) {
## Modifica l'url per il rewriteRule
@cats = split(/\//,$subcat);
my $newurl = "";
for ($count = $#cats; $count >= 0; $count--) {
if ($count ne 0) {
$newurl .= $cats[$count] . "-";
} else {
$newurl .= $cats[$count]; }
}
$url = &urlencode($newurl) . ".htm";
} else {
# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
}
Now you have to modify your .htaccess file adding:
RewriteEngine on
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/$7/$8/$9/$10/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/$7/$8/$9/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/$7/$8/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/$7/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$5/$4/$3/$2/$1/
RewriteRule ^(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$4/$3/$2/$1/
RewriteRule ^(.*)-(.*)-(.*)\.htm$ catalog/$3/$2/$1/
RewriteRule ^(.*)-(.*)\.htm$ catalog/$2/$1/
RewriteRule ^(.*)\.htm$ catalog/$1/
The rewrite rule work only up to 10 subcats, i didn't find any other way to write this rule, maybe someone can help.
I hope this help.
Bye
http://www.sitename.com/...ory/subcat2/subcat3/
to
http://www.sitename.com/...ategory-category.htm
You can see the mod morking here: www.travelstarthere.com
Here how to implement this mod:
Edit links.cfg
find: # URL of User CGI directory. No Trailing Slash.
up of this write:
Code:
###### Mod_Rewrite Option
###### Set to 1 enable the Mod_Rewrite
$mod_rewrite = 1;
now save this file and open site_html_template.pl
find and delete this line:
Code:
$url = "$build_root_url/" . &urlencode($subcat) . "/";now write as follow:
if ($mod_rewrite eq 1) {
## Modifica l'url per il rewriteRule
@cats = split(/\//,$subcat);
my $newurl = "";
for ($count = $#cats; $count >= 0; $count--) {
if ($count ne 0) {
$newurl .= $cats[$count] . "-";
} else {
$newurl .= $cats[$count]; }
}
$url = &urlencode($newurl) . ".htm";
} else {
# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
}
Now you have to modify your .htaccess file adding:
RewriteEngine on
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/$7/$8/$9/$10/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/$7/$8/$9/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/$7/$8/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/$7/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$1/$2/$3/$4/$5/$6/
RewriteRule ^(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$5/$4/$3/$2/$1/
RewriteRule ^(.*)-(.*)-(.*)-(.*)\.htm$ catalog/$4/$3/$2/$1/
RewriteRule ^(.*)-(.*)-(.*)\.htm$ catalog/$3/$2/$1/
RewriteRule ^(.*)-(.*)\.htm$ catalog/$2/$1/
RewriteRule ^(.*)\.htm$ catalog/$1/
The rewrite rule work only up to 10 subcats, i didn't find any other way to write this rule, maybe someone can help.
I hope this help.
Bye