Strip folders with mode _rewrite for better Search engine pages

Author Message

Romeo Antony

Friday 07 January 2011 10:39:53 pm

Hi ,

I would like to set up search engine friendly URL with ezpublish site. For that I know apache mode_rewrite is the best solution . I read from many places that badly configured rewrite rules can make low perfomance in serving pages. rewrite rules conflicts etc.

My ezp is configured to work in virtualhost setup as mentioned in ezp documentation .I have put new a rewrite rule in virtualhost configuartion block. Can anyone pleae tell me these rewrite rule may brings up any conflicts with existing rewrite rules in the virtualhost set up.

All the articles are placed subfolder stories

http://mydomain.com/archive/stories/all artciles are placed here.

But the problem is that , google searches showing the articles title as

article title/stories/archive. (bez of article is placed under archive/stories)

But , I need to show only article title instead of article title/stories/archive.

To eliminate above to get better search engine friendly urls,

I should rewrite the all urls to

http://mydomain.com/article title. (rewrite rules elimaminates archive/stories)

Following is the rewrite rule.

<b><span class="line">RewriteRule ^/archive/stories -</span></b><span class="line">


Anyone thinks that above rewrite rule bring up any conflicts or any issues ? ABove rewrite rule 
can strip archive/stories/ from evey page request

Please give me some ideas.



</span>

André R.

Saturday 08 January 2011 11:12:38 am

You should probably just modify the code that generates the title tag, that is normally what most Search engines use as title.

If webin/flow it's in page_head.tpl

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Romeo Antony

Monday 10 January 2011 12:10:49 am

Thanks Andre. It worked.

Fetch the first item from the reversed path to the target node by offset=0 and max 1.

{set-block scope=root variable=site_title}
{section loop=$Path:reverse_path max=1 offset=0}{$:item.text|wash}{delimiter} / {/delimiter}{/section} - {$site.title|wash}
{/set-block}

Regards

Romeo.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 03:35:57
Script start
Timing: Jan 31 2025 03:35:57
Module start 'layout'
Timing: Jan 31 2025 03:35:57
Module start 'content'
Timing: Jan 31 2025 03:35:57
Module end 'content'
Timing: Jan 31 2025 03:35:57
Script end

Main resources:

Total runtime0.0212 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.3906151.2422
Module start 'layout' 0.00540.0035 739.6328220.7578
Module start 'content' 0.00890.0106 960.39061,002.1016
Module end 'content' 0.01950.0017 1,962.492233.9766
Script end 0.0212  1,996.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002813.3033140.0002
Check MTime0.00115.3699140.0001
Mysql Total
Database connection0.00083.657110.0008
Mysqli_queries0.002411.128630.0008
Looping result0.00000.047210.0000
Template Total0.00136.210.0013
Template load0.00115.002410.0011
Template processing0.00021.155310.0002
Override
Cache load0.00083.832410.0008
General
dbfile0.00083.897680.0001
String conversion0.00000.047240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs