Fork me on GitHub



Make donations with PayPal!
Goal: $100.00
Due Date: Oct 31
Gross Amount: $25.00
Net Balance: $23.72
Left to go: $76.28

kakos  ($25)Oct-25

GitHub Twitter

Learn XOOPS Core

Local Support


XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 4 6 admin adslight Android AntiHarvesting AntiSpam API Apple Battlefield billige Blocks Bootstrap Captcha cell cent chronolabs Clicks Cloud content CĂN demo download Dresses facebook Fat floor Gateway giải Google Guide herre Home Honeypot html5 Human HỘ IP iPhone jQuery Language Law Legal List Loss module modules Monster new newbb news nhiệt NHÀ online PARK Payment phone PHP Prevention profile project Protector publisher RESIDENCE responsive review Rights Room security Sentry Signatures Signed site Smartphone Smarty Smoking Solution Spam stem Studio support tag tdmcreate The Theme themes tháp User userlog weight xoops Xortify XPayment ZendFramework

New Users

Registering user

# 139429


Welcome to XOOPS!


News archives

SEO Paths & .htaccess

Posted by wishcraft on 2008/6/1 13:10:00 (16281 reads) | Posted on Hacks
Well as you may have noticed I have been doing some examples in the wiki for .htaccess this is for primarily SEO Clean Paths for xoops, the modules I have chosen for the example in sharing this code is code for CBB (1.5, 2.2, 3.x), News 1.4+ (May work on earlier), myalbum-P, SmartSection 2.2, CatAds & the userinfo.php page.

What I have been doing over the last few weeks is testing various SEO paths to see what brings ultimate traffic, remember in changing your websites URL you may get sandboxed for a few months as the search engine detects a sitewide change.

Search Engine Optimization is an important step in making friendly paths for both Search Engines and the End Users, you normal for example use a dash (-) not an underscore (_) to SEO as this is detected and more compatible with a search engine algoritms, it is also helpful for natural language query.

You may also find various other SEO improvements you can make to stop keyword stuffing (Example Titles to Keywords) and so on my wiki profile page (these are deep in the forums).

Some example of some friendly SEO paths I have generated are as so:

Content 1.x: ... ent/Introduction-to-ETE/1
News 1.4: ... This-Website/SEO-Paths/14
MyAlbum-P 1.5:,0,10,0,1,titleA
wflinks: ... links/Alien-Information/2,0,0,0,dateA
CBB 3.08: ... t-for-the-Space-Station/8,46,65,0,0,0,0

Remember these SEO paths will increase traffic and delievery into your search engines, you must use a 301 Permanently Moved Redirection as this will remove the old link from the search engine and replace it with the new one.

The general rule for an SEO path is to contain something to do with the title, area of the site and category, remember to include at least the item identification number if possible for legal reasons.

SEO is a big step in improving the cleanliness of your site, as well as your image, we will be doing this here at in the not to distant future.

Printer friendly page Send this story to a friend Create a PDF from the article
Bookmark Me
Bookmark to Google Plus
The comments are owned by the author. We aren't responsible for their content.

Hello Wishcraft , All ..

What you suggest may have problems with non-english langs.

SEO done correctly need to have built-in support in the core (other CMS's usually use a field for it in the content - which maybe difficult in XOOPS case)
or done in phppp's way (article / planet etc' use urls like .../category/4/article/0/p6/....) ....

My company's SEO staff are very expirienced with xoops, and I can tell you that URL's are a small piece of the picture, and dealing with them too much is usually an excuse for badly made content.

Xoops works great with search engines if you choose the right modules and write fresh content as search engines like.
of course there are a lot of SEO tricks that helps, but again - do not rewrite urls and think it'll solve your SEO needs.
Published: 2008/6/1 16:30 • Updated: 2008/6/1 16:30
one more comment:

a mechanism that will collect the all the words that are "X" characters long that repeat "X" times in the content and will put it in the meta-keywords, will match keywords <=> content and will do a lot of good to your relations with google and co.
Published: 2008/6/1 17:09 • Updated: 2008/6/1 17:09
Thanks tzvook, well URL are only in base english characters otherwise they will be converted to %20, if you looked at the examples or a wiki article before commenting what looks more like ad commenting about your "SEO Company", you would have seen that there is command that will be included for doing this called sef that I used a (it will be xoops_sef) in that example.

Well most SEO Companies are wrong namely about stuff like Short URLS and so on, for reasons I am not going to explain to much apart from simply a URL is a very small piece of data for a search engine, too short you are limiting your possible keyword density to long and you are penialised, thes are what called medium URLs, for example my SEO techniques has put major escort site we use for testing this where the competition has billions of high backlinks site etc, into the front page with only 1 backlink.

Well anyway SEF limits the character in the URL to a base english...

What I suggest to module writters if they are putting this in to use the "sef" function not make a "xoops_sef" so it is compatible with later versions and also have something like $xoopsModuleConfig['htaccess'] to turn this on and off in the preferances.

As some people use IIS and other platforms that have no .htaccess
Published: 2008/6/1 18:59 • Updated: 2008/6/1 19:15
Well, I do not believe in sef urls.
I believe in user friendly urls.

They bring you traffic not because they rank you better but because they catch the eye of googlers.

This is my personal opinion and I do not know how a search engine works. I say this just for looking aples falling from the trees.

Anyway, friendly urls are a must for xoops, maybe one day we can have them, nice and easy, minimizing the use of .htaccess with smarty plugins, preloads or something.
Published: 2008/6/1 19:27 • Updated: 2008/6/1 19:27

They bring you traffic not because they rank you better but because they catch the eye of googlers.

Well there is no other way from what I can see to produce a similar URL to thinks like CakePHP which is the sort of URL tsvook is bring up this is the MCV structure, also there are legal argument that the /p6/ isn't page 6 it is a directory path, so loosely in a court case for example you can argue it has no referencial intergrity to the database. Without close code analysis.

Also these URL like the ones you call "friendly" are not benifical they infact limit your search hit ratio by not having any relative content to title or other things.. I would provide you an example but it is against TOS.


Anyway, friendly urls are a must for xoops, maybe one day we can have them, nice and easy, minimizing the use of .htaccess with smarty plugins, preloads or something.

yeah I know the .htaccess is controlled by the module trabis in xoops, it is the quality of SEO information on here that has limited this in the past, this is why I am sharing a few well honed secrets to SEO with you.

Due to the structure of XOOPS from what I can see there is no real way of making this an autonomous system like what you see in some MCV frameworks (which also most are very young, have intrusion and mainly uncommented).

It is upto the module writter etc, this sort of stuff isn't normally done by a programmer in corporate environment it is done by a "network engineer" who tell the programmer what changes to make.
Published: 2008/6/1 19:38 • Updated: 2008/6/1 19:55
Thanks for the orange!
We can make it yes, we can. But we have to end with relative urls inside the modules and specially... inside the core.
inclusion lines include_once('header.php') are not ok.

include_once('dirname( __FILE__ )/header.php') is ok.

If modules and core respect that you could change uris without problem and have modules included by a commom file. Ex:¶m1=etc..

Then we would use htaccess to redirect all calls(with some exceptions of course) to this commom file.

This file would also do the time of commom.php, setting view permissions, languages, globals like $xoopsModule etc. smarty plugin or even this includer would then rewrite links etc(globalising them).

With such power in hands. You could rename module and create other paths in system admin.

I´m not saying this without knowing. I´m very close of makining it but, my regex knowledege is not enought and I´m having problems with some links that are not correclty rewriten.

Humm, this is really tasty, thanks!

Ps: a Function and a database to create unique uri titles for items would be very welcome!
Published: 2008/6/1 19:57 • Updated: 2008/6/1 19:59
Good yeah I to have seen the same approach, however having a fast enough dynamic to the common file is an issue, with load balancing on some big sites. Many site large ones that is like 20 Million pages a day+ would bottle neck with this approach.. But i would love to see a forum post about this in the XOOPS Development when you have it done..

Still old ways are old ways and hard to change... You can't exactly do something also like standardise the variables in a module like file.php?element1=blah&element2=foo and so on, makes writting a module for a noo-b harder and have a common file for page caching either..

Besides, i am happy with the 10 - 60% traffic increases I have seen with this SEF approach. I only did this to ETE in the last day or two so all the URL have to be checked by the SE, for example when a search engine displays it doesn't mean it hasn't used the url in measuring the keyword density of the index and used it in the topology of the best possible result.. It is just for there display if you have for example a URL that is around 450 characters beyond their which varies at cut off you start being penalised...
Published: 2008/6/1 20:05 • Updated: 2008/6/1 20:11
I´d love to see a 20 Million pages a day powered by xoops!

It is a small request for developers, asking them to absolutize urls. The page awareness(map) of a module can be feeded by plugin and it doesn´t have to be the developer to make it, in fact it should be easy enough for a regular user to make one. It would be resource itensive I guess but it would satisfie the non 20 Million pages a day web sites like for example

Just dreaming out loud
Published: 2008/6/1 20:17 • Updated: 2008/6/1 20:17
Example of a plugin:

$pages = array('index.php'=>'myindex','article.php'=>'myarticle');
$args = array('tag'=>'mytag','storytopic'=>'mycat','storyid'=>'mystory');
$reps = array('mynews/myarticle/mystory'=>'myshortlink');
Published: 2008/6/1 20:22 • Updated: 2008/6/1 20:24
Sorry folks, no time today to read it all
Just wanted to answer wishcraft - I do not promote our SEO, from a simple reason - we do SEO just for Israeli sites, and XOOPS is for sure not the audience, so all I write here is for the benefit of the community ( if there is a benefit of course).

I don't underestimate your way of wrewriting url's, just said that "friendly-urls" are more important issue.

About the Orange ??????
Published: 2008/6/2 3:20 • Updated: 2008/6/2 3:21
yeah I know tzvook, Just don't like the comments thing being used as a XoopsAdwords not actually meaning to insinuated really that you are.. Yeah I have been experimenting on various domains with SEO Processes to see what suits for future planning.

Just put in my anchors so we will see how the content horizon is.. Will have to wait for google to make another pass..
Published: 2008/6/2 4:20 • Updated: 2008/6/2 4:21
@ Wishcraft: thanks for your improvements. URL rewriting is of major importance for XOOPS and SEO.

@ tzvook.
I disagree with your ideas on SEO. URL rewriting is important in SEO, at least in languages with a Latin alphabet. Google analyses URLs. Adsense analyses URLs. Keywords in URLs are relevant. Static URLs are indexed more quickly. Rewritten URLs get better links.
Published: 2008/6/2 7:34 • Updated: 2008/6/2 7:34
@ Dona_Brasil
You missed my point - URL rewriting has it's effect for sure, but is much less important then content (fresh, good and written by SEO-aware writer) and it's relevance to "strong links" in it and to page keywrod + description.

Programers tend to go to tech solutions to solve things, and here, the tech-rewriting staff is just a small part of the whole picture, in 90% of net pages, you'll find bad done content (or not good enough) ..
Published: 2008/6/2 16:05 • Updated: 2008/6/2 16:05
@ Dona_Brasil - I totally agreee with a UGC system like XOOPS for community based systems and design, you have little control on content quality or basic content keyword stuffing which tzvook is talking about. This will soon be demoted anyway, when things like google start measuring relative pattern matching in content.. All you can do is anchor it and the User Generated Content will allocate itself to the appropriate level in the engine.. Live already does this so does yahoo..

Anchor Example:

<a id="anchor" class="anchor" name="<{$item.title}>"
Content block ...


a id="anchor" class="anchor" name="<{$xoops_pagetitle}>"
Content block ...

a combination of multiple items on a page:

a id="anchor" class="anchor" name="<{$xoops_pagetitle}>"
a id="anchor" class="anchor" name="<{$item.title}>"
Content block ...
a id="anchor" class="anchor" name="<{$item.title}>"
Content block ...

Published: 2008/6/3 13:26 • Updated: 2008/6/3 13:36
Great news. Good to have rewrite URL option available.

Even so, I do face some problems. I think I missed something.

Test on news module didn't worked for me:

It works, I was confused by other users htaccess SEO codes.
But for article.php I had to use this code:
$story_title sef($_GET['story_title']);
$storycategory sef($_GET['storycategory']);

if (
$ret $xoopsDB->query("SELECT a.storyid, b.topic_id FROM ".$xoopsDB->prefix('stories')." a INNER JOIN ".$xoopsDB->prefix('topics')." b ON a.topicid = b.topic_id WHERE a.title LIKE '$story_title' AND b.topic_title LIKE '$storycategory'");
$storyid$topic_id) = $xoopsDB->fetchRow($ret);
} else {
$ret $xoopsDB->query("SELECT a.title, b.topic_title FROM ".$xoopsDB->prefix('stories')." a INNER JOIN ".$xoopsDB->prefix('topics')." b ON a.topicid = b.topic_id WHERE a.storyid = '$storyid'");
$title$topic_title) = $xoopsDB->fetchRow($ret);
    if (
header"HTTP/1.1 301 Moved Permanently" ); 
header"Location: ".XOOPS_URL."/news/".sef($topic_title)."/"sef($title)."/".$storyid);

Even so, another problem showed up .
global xoopsModule return System instead of News - in breadcrumb but not only (maybe because of the changed path).
Is this happening to someone too ,or is it just me?
Published: 2008/6/13 8:17 • Updated: 2008/6/17 17:29
I do can not make it to forward to

Any help ?

Everything else works like a charm, just the R=301,L redirect would be nice to be added
Published: 2008/9/23 7:54 • Updated: 2008/9/23 7:56
when i am trying to this hack with smartsection the redirected category page is blank. The debug error is

Fatal error: Call to a member function notLoaded() on a non-object in /home/abs/public_html/modules/smartsection/category.php on line 37
All errors (1) queries (7) blocks (0) extra (0) timers (3)
Notice: Only variable references should be returned by reference in file /modules/smartsection/class/category.php line 432

can someone pls help
Published: 2008/11/5 3:12 • Updated: 2008/11/5 3:32