.htaccess

Discussion in 'General Help' started by leonor, Mar 30, 2012.

  1. leonor

    leonor Active Member

  2. Mark
    • Staff

    Mark Administrator Staff Member

    VisioList uses /something to handle the $_GET['a'] value from the query string, so you need to use an identifier to let the script know to expect a category name and not a "source" like "stats"

    I would strongly urge you not to do this, but if you absolutely must....

    you can open index.php and look at modifying these 2 values:
    PHP:
        $TMPL['url_helper_cat'] = 'category/';
        
    $TMPL['url_helper_cat2'] = '/category/';
    can change these to something like:
    PHP:
        $TMPL['url_helper_cat'] = 'c/';
        
    $TMPL['url_helper_cat2'] = '/c/';
    which would make your URL's something like: http://www.toplist.tld/c/Cat1

    but I think that is about as close as its going to get without making drastic changes to the PHP code.

    then you need make the same change in .htaccess
    Code:
    RewriteRule ^rank/(.*)/(.*)/category/(.*)/ index.php?start=$1&method=$2&cat=$3 [L]
    RewriteRule ^rank/(.*)/category/(.*)/ index.php?method=$1&cat=$2 [L]
    
    woudl need to be changed to:
    Code:
    RewriteRule ^rank/(.*)/(.*)/c/(.*)/ index.php?start=$1&method=$2&cat=$3 [L]
    RewriteRule ^rank/(.*)/c/(.*)/ index.php?method=$1&cat=$2 [L]
    
    doing this however will cause other problems I am sure, namely with pagination and probably other parts of the script. Making this change is NOT recommended.
    Anna likes this.
  3. leonor

    leonor Active Member

    hm :/

    okay and when i change "Category" to "Toplist", i will also get trouble with VL ?
  4. Mark
    • Staff

    Mark Administrator Staff Member

    it hard to say without testing, can I ask the reason you want to change this?
  5. leonor

    leonor Active Member

    I talk to a friend how is making SEO, and he say its not good to have this there. (because of ... i forget it :p )
    But when i can change this to other word, i have more keywords in my URL so its a solution for me :)
  6. Mark
    • Staff

    Mark Administrator Staff Member

    consider the pros and cons of such a change.
    A good video from Matt Cutts on the topic:http://searchengineland.com/googles-matt-cutts-on-keywords-in-the-url-16976

    The SEO impact of /category/ in the URL is going to be very small (if any), though this might have been better if we had originally used /c/ for the sake of different languages. I'm not sure this is something we should change in VL at this stage though. But I will look at options for how we can allow even more flexible URL's :)

    You can change /category"/ to another word if you like, just remember you will need to make that change in several files and this will need to be done with each update, I'm not sure this is something that could be handled completely via plugins, I cannot also guarantee the results of other features with this change.

    In the end the potential problems probably outweigh the benefits. I suggest you wait for now, and see what we come out with in future versions, we will be reworking the category URL parts anyway so perhaps we will find a way.
  7. leonor

    leonor Active Member

    okay, i did the changes in last time. And now i found one error in my page.
    [​IMG]

    Normaly its:
    Code:
    http://private-server.ws/[B]category[/B]/Shaiya/
    how i can change this to ?
    Code:
    http://private-server.ws/toplist/Shaiya/

    EDIT:

    okay i changed
    Code:
    $TMPL['url_helper_cat'] = 'category/';
    $TMPL['url_helper_cat2'] = '/category/';
    to
    Code:
    $TMPL['url_helper_cat'] = 'toplist/';
    $TMPL['url_helper_cat2'] = '/toplist/';
    i have to change more things?
  8. Basti
    • Staff

    Basti Administrator Staff Member

    That should do it, but please use a plugin for this else your change is lost next update.
    Also make sure you do not replace your htaccess on the next update. Make a backup of your current file in case we add something new to it ( more likely not ) you can apply it again

    Upload this through plugin manager

    Attached Files:

    leonor likes this.
  9. leonor

    leonor Active Member

    omg know i see my mistake :p i forget it last update to change it again :/

    thanks for the plugin =)
  10. leonor

    leonor Active Member

    shit ^^ i found one problem with this Change when i open
    and scroll down and click then on "2" or ">" its a not changed link like this5
    How i can Change this? I searched in the hours it but i cant find it.

    And i think i have to change /toplist/ to /top100/ i tryed to write this
    Code:
    RewriteRule ^toplist/?$ /top100/ [R=301,L]
    in .htaccess befor
    Code:
    RewriteRule ^toplist/(.*)/ index.php?cat=$1 [L]
    to make a 301 rewrite, but its not working. (and yes i changed every toplist to top100, in plugin to^^)
    Some one have a better idea?
  11. Basti
    • Staff

    Basti Administrator Staff Member

    Unfortunatly that is still hardcoded in vl < 0.9 and is to found in sources/misc/skin.php . You can change it manually for now, 0.9 will have a improoved pagination system and that stuff is a variable there as well, so you would only need to do this once.

    From here on onwards you find several links where you can replace the link part
    Code:
        //CLEAN URL PAGINATION
    
  12. Basti
    • Staff

    Basti Administrator Staff Member

    As far as the redirect goes, you will face big issues if you use htaccess for it. Its better to construct a 301 redirect in the plugin file, can be more dynamic there.
    Please attach your current plugin and ill write the code for you
  13. leonor

    leonor Active Member

    Nice! When i have solution for the redrict i will change it.

    My current plugin? oO i use the plugin from this Thread and some normal Plugins so i can't attach you anything :(
  14. Basti
    • Staff

    Basti Administrator Staff Member

    Yes, pls post the plugin you use currently ( from this thread ) so i have all the changes you made. Or havent you edited anything from it? Been half a year, so bear with me :) Did we/you customized it further? or are there just the 2 lines of code as in this thread?
  15. leonor

    leonor Active Member

    we changed only this 2 lines from this thread, and the changes in .htaccess file.
  16. Basti
    • Staff

    Basti Administrator Staff Member

    Alright, ill use this one then. ill try it out later today or tomorrow with either php or htaccess
    leonor likes this.
  17. Basti
    • Staff

    Basti Administrator Staff Member

    Ok Leonor, you were close with your solution :)
    Add this to your htaccess at the bottom

    Code:
    ################ Redirect old urls
    RewriteRule ^toplist/(.*)$ /top100/$1 [R=301,L]
    Unfortunatly, this does not seem to work for the pagination links, but they are no follow anyway, so you should have close to zero of them indexed.
    leonor likes this.

Share This Page