Support Forums

SEO: Moving listings ID at the end

This is a discussion on SEO: Moving listings ID at the end within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Hi! I was trying to put the listings-ID at the end. Example: domain.de/anzeige/name-of-listing-1.html I did the following changes: htaccess: PHP ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 05-25-2009, 12:24 PM   #1
Junior Member
 
Join Date: Jun 2008
Posts: 12
Rep Power: 14
Markus is on a distinguished road
Default SEO: Moving listings ID at the end

Hi!

I was trying to put the listings-ID at the end.

Example: domain.de/anzeige/name-of-listing-1.html

I did the following changes:

htaccess:
PHP Code:
RewriteRule ^anzeige/([0-9a-zA-Z_-]+)-([0-9]+).htmlviewlisting.php?view=$[NC
hooks.php in 68 seo module:

PHP Code:
$string="anzeige/".$string."-".$row['id'].".html"
That does not work for me - what�s wrong?

Thanks,
Markus
Markus is offline   Reply With Quote
Old 05-25-2009, 12:44 PM   #2
Junior Member
 
Join Date: Jun 2008
Posts: 12
Rep Power: 14
Markus is on a distinguished road
Default

Hi!

One more thing, maybe you can help me with this as well:

I have to rewrite special german characters in the url:

� = oe
� = ae
� = ue

an so on.

Where do I have to implement the function to convert?

Thanks again,
Markus
Markus is offline   Reply With Quote
Old 05-25-2009, 02:06 PM   #3
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,342
Rep Power: 84
seymourjames is a jewel in the rough
Default

From an SEO perspective I see no point to putting the ID number at the end. For example, this is quite adequate. The main purpose of these no php formats is for humans and not for search engines.

http://www.mydomain/listing-x-blablabla.html

If you do this you will need this line below in your .htaccess and also be aware that plugins designed to work with the normal SEO module supplied by 68C may need slight modification or they will not work. Modules I believe that may not work are the horizontal listings unless you change the link structure inside of the module.

RewriteRule ^listing-([0-9]+)-([0-9a-zA-Z_-]+).html$ viewlisting.php?view=$1 [NC]
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 05-25-2009, 02:19 PM   #4
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,342
Rep Power: 84
seymourjames is a jewel in the rough
Default

I can see why you might want to put German characters into the meta tags and for the page title but not in the url. Google et al are fully aware of how to convert from what people type in a search into ascii for example.

Only ascii characters can be used in urls. So if you use safe encoding of say � then it is %F9 . Hardly readable and pointless in a url string. You are also likely to suffer many problems with different browsers doing things differently. IE is horrible. Read this.

HTML URL Encoding Reference
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 05-26-2009, 02:58 PM   #5
Junior Member
 
Join Date: Jun 2008
Posts: 12
Rep Power: 14
Markus is on a distinguished road
Default

Hi!

Thanks for your reply.

From an SEO perspective I just want to have the most relevant terms closer to the URL. You�re right, it must fit both, title keywords in the URL for SEs (though they should be able to read dynamic URLs) and nice, readable URLs for humans. As for the SEs, I made good experience putting everything that is relevant on top/the beginning.

Your modification gives me a 404.

What about the mod in the hook.php - is that correct?

German chars:

I don�t want to put them in the URL. I want to remove/replace them in the URL - because (like you wrote) they can�t be placed in an URL. The URL is build by the title of the ad - if it�s "sch�ne Z�ge zu verkaufen", it would destroy the URL. I would like to replace the chars to "schoene Zuege zu verkaufen". Where do I have to modify?

Thank�s for your help!
Markus
Markus is offline   Reply With Quote
Old 05-26-2009, 03:21 PM   #6
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I don't know for sure, but it would seem logical to me that the key lies in the listing_url function.

This function first decodes the title, then it has a series of replace commands. It would seem to me that you simply need to add the additional replace commands for each entity that you need to replace.

example:
PHP Code:
$string=str_replace('�''o'$string);
$string=str_replace('�''u'$string); 
I'm certainly no php expert, so others may have a better method. This is how I would approach it though.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and 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
Mike-N-Tosh is offline   Reply With Quote
Old 05-26-2009, 03:24 PM   #7
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

Try this. Open modules/seo/hooks.php and find:
$string=preg_replace('/\W/e', '', $string); // LINE 32

Just below it add:
$string = convert_accented_characters($string);
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 05-26-2009, 03:47 PM   #8
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

See, Eric is an "other" that has a better method!
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and 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
Mike-N-Tosh is offline   Reply With Quote
Old 05-26-2009, 04:15 PM   #9
Junior Member
 
Join Date: Jun 2008
Posts: 12
Rep Power: 14
Markus is on a distinguished road
Default

Thank you both!

I think Mike�s solution does not work in the hooks.php.

Eric: Where can I find that funktion? Your solution works, but it will replace everything by "a" - maybe I can tweak it a little bit to replace the chars like in Mikes post ...

Thanks,
Markus
Markus is offline   Reply With Quote
Old 05-26-2009, 04:17 PM   #10
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

This is in includes/functions.php the second to last one.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How we are moving forward! Eric Barnes News & Announcements 12 06-04-2009 08:45 AM
Moving an ad/listing redstar Technical Support 1 11-15-2008 10:29 AM
Moving to new hosting seymourjames Technical Support 3 09-10-2008 11:23 AM


All times are GMT -4. The time now is 08:21 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0