Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

where is the file of this function ? : $Discussion->Url;

WallasWallas New
edited June 2014 in Vanilla 2.0 - 2.8

Hello,

I just created my forum with vanilla.

-rankplus.fr

However, for SEO reasons, rewritten URL does not suit me.
The triplet: URL, Title, H1 ... it is not good for SEO.

I saw several files in it:

$Discussion->Url;

But where it is the function that generates the URL?
In which file?

I would like to modify, to replace discussions URL:
-http :/ / rankplus.fr/discussion/12/bienvenue-aux-nouveaux-membres

by:
-http :/ / rankplus.fr/discussion/12.php

To eliminate triplet.

if someone know where is the file of this function.

$Discussion->Url;

Thank you very much for your help.

:)

Tagged:

Comments

  • Options

    you could use grep to find it. search your source files google on how to use grep.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    Thank you for the tip, I use search "in the file content" with OSX. That usually works well to find the code in files.

    Trying as research and other "URL function."
    But I can not find it. : (

    I spent several hours, usually I easily find and I can manage.
    But then, with Vanilla, I have not yet grasped the logic of programming. This is the first time I use it.

    I thought that maybe if I ask anyone know what this file is this function URL.

    Thank you peregrine :)

  • Options
    peregrineperegrine MVP
    edited June 2014

    lets say you change the function that replaces the Url (I'm not advocating you do, since it probably is the wrong way to go about things, and won't make much difference in with SEO).

    do you know the Url that you want to change it to, would work.

    I would like to modify, to replace discussions URL: -http :/ / rankplus.fr/discussion/12/bienvenue-aux-nouveaux-membres

    by: -http :/ / rankplus.fr/discussion/12.php

    e.g. http :/ / rankplus.fr/discussion/12.php will this take you to the discussion you want. I don't think so.

    but in answer to your question where is a Url function

    library/core/functions.general.php:3045:   function Url($Path = '', $WithDomain = FALSE, $RemoveSyndication = FALSE) {
    
    library/core/class.format.php:1467:   public static function Url($Mixed) {
    library/core/functions.general.php:1467:         $Discussion->Url = DiscussionUrl($Discussion);
    library/core/functions.render.php:409:function DiscussionUrl($Discussion, $Page = '', $WithDomain = TRUE) {
    

    I don't think you will have much success modifying core functions, and it will probably not work the way you intend it to anyway.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    Thank you very much for your help, :):)

    I will do tests, possibly I'll just format:
    Which probably will be easier.

    -.../discussion/12/12.php

    Who should not take a lot of mods in the core.

    The main thing is not to have the triplet:

    the thread title
    url : the-thread-title

    <

    h1 : the thread title

    The rewrite for the categories is good, slightly changing the h1 with vanilla seo plugin.

    As soon as I finished translations in French vanilla 2.1, I just add them. I have a few lines to finish and verify.

    ;)

  • Options
    x00x00 MVP
    edited June 2014

    You are misinformed about SEO.

    What you want to replace it with is not better for SEO. The php part is meaningless naming a virtual address with php serves no real purpose, and you would need to change not only the link but the server rules to direct it to the controller. The number whilst useful for vanilla is not to do with seo. Although some may argue for putting the title/slug first and number last, this is splitting hairs, as this is very marginal.

    There are lot of SEO myths, and some old SEO advice, which is either redundant, or it is effect is very negligible, and hard to prove has any really advantage over naturalistic content which by far is the biggest determinant.

    h1, h2, etc have very little significance these days, that was old years ago.

    There are a lot of myth surrounding harm that certain combinations may do, or over exaggerate the benefit of certain combinations. Think about it logically, the more sophisticated google's algorithms get then more they are going to model a common sense approach to valuing content that people are going to want. So therefore penalizing a large section of the web for arbitrary reasons make no sense. This is an extremely common style, it will not be a massive advantage, but there certainly not a harm. On the counter, why do think that you will get rewarded simply for doing what you want? You think Google is that naive? Maybe back in the early days. Not in this day and age. They don't want it to be that easy.

    Also around duplicated content, yes it is bad, but goggle is smart enough to differentiate from reasonable duplication such as titles and excerpts, to full blown duplication.

    Google's algorithms aim to put SEO experts out of business, becuase they want to be at the level that their algorithms can basically know the relevance of content as a human would value it. Ok we are not quite there yet but it is getting a lot better, and a lot of the old SEO thinkings simply don't apply anymore.

    SEO these days is very much about content not tricks. Naturalistic use, where you are providing, or encouraging you users to generate useful content which is varied and of high quality (which requires behavioral techniques not traditional SEO), is far more valuable than these tricks.

    grep is your friend.

  • Options
    ShadowdareShadowdare r_j MVP
    edited June 2014

    You can override the DiscussionUrl function via a plugin, but then you may have to change how the routing works and add some rewrite rules; however, the way Vanilla puts together the link is better for SEO in that /discussion/12/bienvenue-aux-nouveaux-membres is more clean, readable, and descriptive than /discussion/12.php. As @x00 explained, there are a lot more complex algorithms involved with search engines for finding information beyond the URL structure itself, such as the actual content on the page, which is actually what makes the most difference.

    Add Pages to Vanilla with the Basic Pages app

  • Options

    Also if you piss off your users relentlessly following SEO, your bounce rate will go up, which is big killer for search ranking. Search engine ultimately care more about what users want, not just a mechanical checklist.

    grep is your friend.

  • Options
    WallasWallas New
    edited June 2014

    @x00 said:
    You are misinformed about SEO.

    What you want to replace it with is not better for SEO. The php part is meaningless naming a virtual address with php serves no real purpose, and you would need to change not only the link but the server rules to direct it to the controller. The number whilst useful for vanilla is not to do with seo. Although some may argue for putting the title/slug first and number last, this is splitting hairs, as this is very marginal.

    Over-optimization, it is not good for SEO.

    In the case of vanilla was a triplet, and this is clearly Over-optimization.

    it could happen if it was not there the triplet of nag.
    off, title, h1 and rewrite his identical. It faudrais otherwise be able to customize the title tag, h1 or to break the triplet.

    From my experience, I clearly found a page that does not rewrite, it ranks much better than the rewrite. The extension. Php is not critical.

    On my sites I do not use the rewrite on the cards for a long time:

    The triplet is too aggressive.

    -http ://limonads.com/5573.php

    -http ://divinyles.fr/84.php

    -http ://i-luc.fr/190.php

    ...

    For example, type in Google for example:

    • "Duplicat content prestashop"

    • "disques vinyles the cure" --> look on page 2 there are 5 pages of my site (there is not the rewrite)

    You will notice that I have very few links, but the plugs are properly positioned.

    Only for cétagories.

    For rankplus I made ​​to end like this:

    -http ://rankplus.fr/discussion/12/

    Thank you for your answers and for taking the time to answer me. ;)

    Cordially

  • Options
    x00x00 MVP
    edited June 2014

    @Wallas, this is not over-optimisation.

    I clearly found a page that does not rewrite, it ranks much better than the rewrite.

    Prove it has anything to do with your change, I bet you can't. A lot of SEO advice lacks definitive proof. Each page is different so will get a different rank. You sample size in tiny, you would need a sample size of millions, averaged out, to make any conclusion at all.

    More likely it has to do with content.

    However suit yourself.

    grep is your friend.

  • Options

    I understand it is difficult to prove.
    Each site is different and react differently.

    However there are pros SEOs who for several years now recommend avoiding triplet. Do not use the rewrite, it is a choice. Otherwise it is possible to use, and shall break in triplet otherwise.
    h1 different from the title tag, for example.

    This is important, when in addition, the title tag and H1 also in its meta description. ;)

    breaking the triplet, it allows more flexibility, that is to say that there is less chance that it is considered the suroptimisation.

    After it is right SEO recipes, there are many.
    Do not use the rewrite on the cards, so it is a choice I personally do not encourage to do the same. It's just a personal preference. After that, maybe I'm wrong. ;)

    With Google, there is never anything exact. What works for one site may not work for another site. However, I prefer to leave without the rewrite on the cards.

  • Options
    x00x00 MVP
    edited June 2014

    If you want to change it make sure you use use view overrides rather then editing the core as this will get overitten with updates.

    In 2.1 there is also the function DiscussionUrl that you can override by predefining.

    You can also change H1 and title in theme.

    Forget about the .php part. I don't know what you talking about rewrites, Google doesn't know or care if you rewrite the urls, but it does care about meaning.

    Whether you use just number or not it is still going through a single dispatcher, the server rules still rewrite the url to index.php That is just how MVC frameworks work.

    In fact that chances that you are not using server rules like on a modern dynamic site is pretty uniquely, google isn't goign to reward static sites over dynamic content, or sites the don't appear to use a dispatcher. In fact google's own infrastructure is going to use modern technique like this.

    grep is your friend.

  • Options
    WallasWallas New
    edited June 2014

    Thank you very much x00, B)

    I did not know there was overide.

    it's just, it will be cleaner not change the core.

    I also changed another function to set noindex some pages and avoid duplicate content.

    -http: //rankplus.fr/discussion/12/ ( ok )

    -http: //rankplus.fr/discussion/12/bienvenue-aux-nouveaux-membres ( duplicate )

    -http: //rankplus.fr/discussion/12/bienvenue-aux-nouveaux ( duplicate )

    3 links point to the same page.

    The second and third URL, there is the meta robots noindex + meta canonical.

    ;)

  • Options

    x00 on the rewrite: many people are abused by spend series of keywords. For internal SEO site, it has no more benefits.
     
    Afterwards, indeed, one of the main benefits (indirect) rewrite is when users make links on a page (without anchors). The page has keywords that are in the URL.

    it helps to have clean URLs without parameters like:

    / Index.php? Id = 3 & type = cat & order = a

    So the rewrite theoretically it should help the user to identify the content of the page. But it is double-edged, 10 km URL will not be easy to remember where to identify.

    A page with this URL:

    ../24.php

    It will be much easier to remember it:

    ../24/this-is-my-list-of-keywords-user-friendly-and-for-my-great-mother

    And also, I do not know anyone directly typing this kind of URL in their browser.

    In search engines, the user identifies the page with the title and description, not with the URL rewrite. Even less if the rich snippets are used

    So in practice, the URL rewrite is interested for the user that when he shipments URL by email, or when you put a link on a forum (for example)

    The usefulness of having keywords in the URL, it remains marginal to users. So ... a website that uses the URL with keywords, there is more likely it is that for seo, for users.

    A Url like this,

    ../22.php

    Google, know perfectly well if it is a modern dynamic site or not. -> Footprint CMS

    and also, a lot of indicators that generates a dynamic site. (Dates, comments, ...)

    It has the advantage against:

    -> It is never too long.

    -> It breaks the triplet

    -> It can be much easier to remember

  • Options
    x00x00 MVP
    edited June 2014

    @Wallas no offense but you are teaching grandmother to suck eggs. I also think that perhaps there is a language barrier so some things are getting lost in translation.

    There is no reason why a user has to type the entire slug, it will resolve with just the number. But why would they remember a number either, out of hundreds? The fact is they would just bookmark the url if they need to.

    I have explained multiple time that the .php part is redundant. The extension is meaningless to both google and the application. I guess the only reason why you would do it to give the impression there a bunch of numbered files being written every time a post is made, but anyone with a rudimentary knowledge of how a website works knows in most cases, the data is in the database and there is some sort of dispatcher and templating system.

    What I'm saying is google is not bothered about your server rules generally, they don't care if to doesn't affect status. They are interested in data.

    You said you are new tot he infrastructure of vanilla, the first thing to note is it is MVC

    http://en.wikipedia.org/wiki/Model–view–controller

    That mean everything goes through the one dispatcher, and only one php file need to be pointed to index.php, the rest of the php files are not handled directly. All good addons use this system too. Secondly you will never see an url like / Index.php?Id=3&type=cat&order=a in the core. urls are in the form index.php?p=/controller/method/params it that simple. You will only occasionally get other query string parameters besides p.

    grep is your friend.

Sign In or Register to comment.