Loading ...

[solved] Remove Artist and videoID from Url

Board index / PHP Melody - Video CMS / PHP Melody 1.6.x (old version)

Forums for the previous PHP Melody version (1.6.x)

Postby osa on Nov 06, 2008 11 am


PHP Melody uses a SEO url format like this:

http://www.sitename.com/artist/music-title_videoID

im not using php melody for music videos, but for general videos, especialy animation and commercials related

I'm upgrading from a planaform were I I'm using simple Urls like

http://www.sitename.com/music-title

I already have several pages indexed in google, and I know I have to change the functions.php and .htaccess for this to work but I cant figure it out. Please help me.
osa
Non-verified
Non-verified
 
Posts: 21
Joined: Oct 28, 2008 2 pm
Reputation points: 0

Postby Paul on Nov 06, 2008 12 pm


VideoID is a must. If you remove this from your links, no video will be identified.

To change the format of your video links, open include/functions.php and find this:
Code: Select all
$return = _URL.'/'.$artist.'/'.$song.'-video_'.$id.'.html';


Change it as you wish. Then, update your .htaccess with the new format.
Paul
Developer
Developer
 
Posts: 772
Joined: Jul 14, 2007 9 am
Reputation points: 38

Postby osa on Nov 06, 2008 12 pm


wow, fast reply!

I found the functions.php line, but I keep getting a 404 error, when changing the .htaccess line. I know the line to change, but dont know what to remove.

I will keep the id
osa
Non-verified
Non-verified
 
Posts: 21
Joined: Oct 28, 2008 2 pm
Reputation points: 0

Postby Paul on Nov 06, 2008 1 pm


This is the line you have to edit in htaccess:
Code: Select all
RewriteRule ^(.*)/(.*)-video_(.*).html$ musicvideo.php?vid=$3


The first "(.*)" is for 'Artist', the second is for 'Video Title' and third is for 'VideoID'.

Just edit the first part:
Code: Select all
^(.*)/(.*)-video_(.*).html$
Paul
Developer
Developer
 
Posts: 772
Joined: Jul 14, 2007 9 am
Reputation points: 38

Postby osa on Nov 06, 2008 2 pm


Many thanks Paul. But its still not solved.

This is how I have it now to remove the artist from the URL:

functions.php :
Code: Select all
$return = _URL.'/'.$song.'-video_'.$id.'.html';


.htaccess :
Code: Select all
RewriteRule ^(.*)-video_(.*).html$ musicvideo.php?vid=$3


No error this time , but it keeps redirecting to the main page.

Not to abuse your patience.
osa
Non-verified
Non-verified
 
Posts: 21
Joined: Oct 28, 2008 2 pm
Reputation points: 0

Postby Paul on Nov 06, 2008 3 pm


The htaccess rule should look like this:
Code: Select all
RewriteRule ^(.*)-video_(.*).html$ musicvideo.php?vid=$2
Paul
Developer
Developer
 
Posts: 772
Joined: Jul 14, 2007 9 am
Reputation points: 38

Postby osa on Nov 06, 2008 4 pm


Working just great. Thanks Paul for the amazing support. 8-)
osa
Non-verified
Non-verified
 
Posts: 21
Joined: Oct 28, 2008 2 pm
Reputation points: 0

Postby kztixo on Jun 07, 2012 6 pm


Google takes as a duplicate, so penalize you if you see that you can enter the URL that had the artist and no artist now. As you would do in the htaccess to avoid having to put one by one the url changed.
Thanks
kztixo
Verified Customer
Verified Customer
 
Posts: 31
Joined: Oct 23, 2008 6 pm
Reputation points: 0

Postby mephisto on Jun 07, 2012 9 pm


kztixo wrote:Google takes as a duplicate, so penalize you if you see that you can enter the URL that had the artist and no artist now. As you would do in the htaccess to avoid having to put one by one the url changed.
Thanks

not if you give google a canonical URL in your head section. Then it will use that always.
mephisto
Verified Customer
Verified Customer
 
Posts: 2888
Joined: Sep 30, 2008 8 am
Reputation points: -6

Postby maniaka55 on Dec 13, 2019 1 am


Up

How to do it on apollo
maniaka55
Verified Customer
Verified Customer
 
Posts: 63
Joined: Jun 10, 2013 11 am
Reputation points: 10


Who is online

Users browsing this forum: No registered users and 0 guests