|
|
#1 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,618
Rep Power: 40 ![]() |
Hi,
I have one big on-page SEO problem that I would like to solve. Well 2 actually and I am done with my site and ready to promote it (phase 1) through normal means. 1. I have created a metatgs.tpl file which I include in my layout.tp file so I can change the title, description and keywords for most pages. However I am stuck trying to find a unique logical test for the main categories page and only that page. I am able to get all the sub categories to have unique titles, the features page, new listings, etc but not the main browse page itself. I have tried lots of things but I cannot get the syntax or the test. I have this which works well for the sub catogries but my main categories page keeps defaulting the title tag to the http address and not something I would like to define explicitly - in my case a title like French Properties. Here is what I have already. I am seeking the syntax and variable of IFf test itself. {if $SCRIPT_NAME == "/category.php"} {foreach name=outer item=contact from=$breadcrumb} {foreach item=item from=$contact} {assign var=category value=$item|strip_tags} {/foreach} {/foreach} <title>{$category}</title> <meta name="Description" content="{$sitedescription}" /> <meta name="Keywords" content="{$sitekeywords}" /> {else} ..... further tests for other pages which render correctly {/if}{/if}{/if}... {/if} 2. My second problem is that the SEO module works well but for pages I create using the page editor, it takes the ID number and makes a IDnumber.html . My question is how to get an address like frenchestateagents.html for a page like page/8.html. How can I assign the title of the page which I have changed successfully to be the URL or something more meaningful at least. As a quick aside: we should make a big SEO thread. How to optimize 68 classifieds. What we should all be doing!!!! Last edited by seymourjames; 05-06-2008 at 10:00 PM. |
|
|
|
|
|
#2 |
|
68 Evangelist & Developer
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,725
Rep Power: 50 ![]() ![]() |
I'm no php programmer, however it seems as you're working with the variable $breadcrumb. When you view the browse categories page, there isn't a $breadcrumb. So perhaps you could start out your logic with something as simple as:
PHP Code:
-Mike
__________________
Mike-N-Tosh IndianaPC.org - A community website (v3.1.10 Developer - heavily modified) Sandbox (v3.1.10, v4.0.9, 4.1.5) Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
|
|
#3 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,618
Rep Power: 40 ![]() |
A star tip for changing the meta tags on pages like category and search. It works and does not make a mess anywhere else from what I can see so far. Important to place the test within the outer IF so not to effect the subcategories,
{if $SCRIPT_NAME == "/category.php"} {if empty($breadcrumb)} <title>French Properties For Sale</title> <meta name="Description" content="property in france including properties in south france, south west france, west france, east france, north france, central france and corsica}" /> <meta name="Keywords" content="property south france,property south west france,property west france,property east france,property north france,property central france,property corsica,french,property,france" /> {else} {foreach name=outer item=contact from=$breadcrumb} {foreach item=item from=$contact} {assign var=category value=$item|strip_tags} {/foreach} {/foreach} <title>{$category}</title> <meta name="Description" content="{$sitedescription}" /> <meta name="Keywords" content="{$sitekeywords}" /> {/if} Now onto problem 2. On we go with my site for French Property. Still a general SEO forum would be a good idea as we with 68C have specific needs!!! |
|
|
|
|
|
#4 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,618
Rep Power: 40 ![]() |
So the solution to better SEO friendly pages. If people want to do the same thing then this is how I did. It seems to work and perhaps it is obvious but it was not obvious for me. In the .htacess file leave it as it is but then create a new section for your more friendly URLs for the pages you have created with the page editor, your top-level categories page, featured and new pages. The only exception is you can delete or comment out the rewrite for the main categories page.
I tried modifying the standard top listings , featured new and the pages mod_rewrites by replacing my desired URLS but it never seemed to work so I let it do its thing and rewrote the URLs again below. For example, I tied replacing RewriteRule ^page/([0-9]+)\.html$ pages.php?page=$1 [NC] with RewriteRule ^property-in-france/([0-9]+)\.html$ pages.php?page=$1 [NC] but it fell over continually. Here is the code which seems to work. #categories - I commented out the top level page but left the rest #RewriteRule ^categories\.html$ category.php [NC] RewriteRule ^categories/([0-9a-zA-Z_-]+)\.html$ category.php?cat=$1 [NC] RewriteRule ^categories/([0-9a-zA-Z_-]+)/page/([0-9]+)\.html$ category.php?cat=$1&page=$2 [NC] #cat sorting RewriteRule ^categories/([0-9a-zA-Z_-]+)/sort/([0-9a-zA-Z_-]+)/order/(desc|asc)\.html$ category.php?cat=$1&sortfield=$2&sortorder=$3 [NC] RewriteRule ^categories/([0-9a-zA-Z_-]+)/sort/([0-9a-zA-Z_-]+)/order/(desc|asc)/page/([0-9]+)\.html$ category.php?cat=$1&sortfield=$2&sortorder=$3&page =$4 [NC] #pages RewriteRule ^page/([0-9]+)\.html$ pages.php?page=$1 [NC] #top lisitngs RewriteRule ^listings/(featured|new|top)\.html$ toplistings.php?pg=$1 [NC] RewriteRule ^listings/(featured|new|top)/([0-9]+)\.html$ toplistings.php?pg=$1&page=$2 [NC] # MY CHANGES # CHANGE THE MAIN CATEGORY URL RewriteRule ^properties-france\.html$ category.php [NC] # CHANGE THE FEATURED AND NEW LISTINGS URLs RewriteRule ^french-properties\.html$ listings/featured.html [NC] RewriteRule ^properties-in-france\.html$ listings/new.html [NC] # CHANGE MY PAGES (URLS) CREATED WITH THE PAGE EDITOR RewriteRule ^property-in-france\.html$ page/3.html [NC] RewriteRule ^property-france\.html$ page/12.html [NC] RewriteRule ^property-for-sale-france\.html$ page/8.html [NC] RewriteRule ^mortgages-france\.html$ page/9.html [NC] RewriteRule ^leasebacks-france\.html$ page/10.html [NC] I hope this helps somebody else at the same phase of their development project. If anybody wants to pass comment on my site French Property then please do. We all need help |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Quick SEO optimization for showlistings | civ | v3.1 Modules & Modifications | 2 | 01-03-2007 10:26 AM |
| Site optimization | spaceboy | Site Marketing | 26 | 10-09-2006 03:35 AM |