Howtodude.NET / How to rewrite URLs for SmartSection
Views:14
Categories:
Howtodude.NET
> Computers
> Internet
> CMS
> XOOPS
Aim:The users of your website prefer URLs like www.example.com/beach-resorts.html to URLs like www.example.com/modules/smartsection/item.php?itemid=1. Rewriting a URL in a way that it becomes descriptive will probably improve your ranking in search engines like Google, Yahoo or MSN. This howto describes how to rewrite URLs for SmartSection 2.13, a content management module for XOOPS, XOOPS Cube and ImpressCMS.
How to rewrite URLs for SmartSection:Nearly out-of-the-box, SmartSection allows to rewrite a URL like www.example.com/modules/smartsection/item.php?itemid=41 to URL's like www.example.com/smartsection.item.41/orlando-florida.html or www.example.com/ss.item.62/orlando-florida.html . This greatly improves your search engine ranking for two reasons. In the first place, search engines are known to prefer static URLs. Secondly, you have a number of relevant search terms in your URL. For a blog or a news section, this way of URL rewriting is probably the best available for XOOPS. If you download and extract SmartSection from www.smartfactory.ca, you will find a file called seo.txt in the extra/seo folder. This contain the instructions of rewriting URL's this way. RewriteEngine On
RewriteRule ^destinations$ /destinations/ [R=301] RewriteRule ^destinations/$ modules/smartsection/seo.php?seoOp=item&seoArg=1 [QSA,L] The "1" in the code above can be replaced by any article's number. In case you have a multilingual site, you should do it like this: RewriteRule ^destinations$ /destinations/ [R=301] RewriteRule ^destinations/$ modules/smartsection/seo.php?seoOp=item&seoArg=1〈=en [QSA,L] In order to get www.example.com/destinations/florida/best-hotel-deals.html , add something like this for each URL to your .htaccess file: RewriteRule ^destinations/florida/best-hotel-deals.html$ modules/smartsection/seo.php?seoOp=item&seoArg=2 [QSA,L]
RewriteRule ^destinations/florida/best-hotel-deals.html$ modules/smartsection/seo.php?seoOp=item&seoArg=2〈=en [QSA,L]
User-agent: * Disallow: /modules/smartsection/ Final advice: Keep some structure in your .htaccess file, especially if you are rewriting this way as your .htaccess file may become very lenghty. Structure makes it much easier to manage.
Disclaimer: this howto reflects the personal opinion of the writer.
The comments are owned by the poster. We aren't responsible for their content.
Add YOUR own howtos today! It's fun, it's free, increase your productivity! Archive your own howtos on Howtodude.NET so that you can access these from everywhere at every time! |
|