MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completely customizable, expandable and suitable for all needs.
A2Hosting
Moderators: Moderators
Forum RSS feedReply
ModRewrite for Youtube
AuthorText
Syncro
Junior Member

Posts: 90
Contributes: 92

Gender: _MALE_
Online: No

Languages: Syncro
Date: 09/05/2010 22:49
ModRewrite for Youtube
#post23995
Site url: http://www.tuning-links.com
MemHT version: 4.0.1
Hosting OS: Linux
I want to reWrite the titles in Youtube section to be SEO friendly
For example:
.../index.php?page=youtube&op=show&id=343 ---> youtube_Making+of+Miss+Tuning+Calendar+2009.html
Delete Edit Quote
 
Syncro
Junior Member

Posts: 90
Contributes: 92

Gender: _MALE_
Online: No

Languages: Syncro
Date: 17/05/2010 20:45
Re: ModRewrite for Youtube
#post24008
Smile
Delete Edit Quote
 
Syncro
Junior Member

Posts: 90
Contributes: 92

Gender: _MALE_
Online: No

Languages: Syncro
Date: 25/07/2010 16:33
Re: ModRewrite for Youtube
#post24174
OK I did it by myself

WARNING: Do it on your own risk!
Backup your files before start!

In ../pages/youtube/index.php
change all
code
a href='index.php?page=youtube&op=show&id'

with
code
a href='index.php?page=youtube&op=show&id=$id&title=".mem_urlencode($title)."'



In .htaccess I use
code
# Youtube -------------------------------------
        RewriteRule ^youtube.html$ index.php?page=youtube [L]
        RewriteRule ^youtube_([0-9]+)_([^_]+).html$ index.php?page=youtube&op=show&id=$1&title=$2 [L]
        RewriteRule ^youtube_browse.html*$ index.php?page=youtube&op=browse [L]
        RewriteRule ^youtube_search.html*$ index.php?page=youtube&op=search [L]


In .../inc/inc_modrewrite.php

after //YouTube (line 165) insert
code
"`".$siteConfig['site_url']."/index.php?page=youtube&(amp;)*op=show&(amp;)*id=([0-9]+)&(amp;)*title=([^&#'"_]+)(['|"|#])`is",


and after //YouTube (line 287) insert
code
$siteConfig['site_url']."/youtube_3_5.html6",


Now I have SEO friendly urls in my Tuning Video section
Edited: 25/07/2010 19:01
Delete Edit Quote
 
mem
MemHT's Dad
Admin & Developer

mem

Posts: 7243
Contributes: 4800

Gender: _MALE_
Online: No

Languages: English, Italiano, Македонски, Српски
Date: 25/07/2010 21:53
Re: ModRewrite for Youtube
#post24175
Oh, i didn't even see this thread : Tough days...
Follow me on twitter if you want to be updated on the MemHT 5 development.
Delete Edit Quote
 
Syncro
Junior Member

Posts: 90
Contributes: 92

Gender: _MALE_
Online: No

Languages: Syncro
Date: 25/07/2010 22:16
Re: ModRewrite for Youtube
#post24176
OK you'll buy a beer when we see each-other Smile

To work your share button correctly you need to fix some code:

in ...pages/youtube/index.php
line 230
code
  addthis_url    = '<?php echo $siteConfig['site_url']."/index.php?page=youtube&op=show&id=$id"; ?>';


change into
code
addthis_url    = '<?php echo $siteConfig['site_url']."/index.php?page=youtube&op=show&id=$id&title=".mem_urlencode($title) ?>';
Delete Edit Quote
 
Syncro
Junior Member

Posts: 90
Contributes: 92

Gender: _MALE_
Online: No

Languages: Syncro
Date: 25/07/2010 22:57
Re: ModRewrite for Youtube
#post24177
Mem, it would be very nice to tell us what to do so the title for every page begin with the title of the video (like: Video title|MemHT portal-Free PHP CMS and Blog)
I hope you see this this time Smile
Delete Edit Quote
 
Reply
Tags Cloud
Twitter updates...
Help MemHT Portal
Navigator
Users Block
Hi Guest
IP: 38.107.179.230

Username
Password
MemHT Wiki
Language
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo