Announcement

Collapse
No announcement yet.

Mod Rewrite Friendly URLs => .htaccess

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MattyAsia
    replied
    Originally posted by PitchouneN64ngc View Post
    You can add one more rule. This rule is for the 'Configure' link into the widget manager (admincp).

    Code:
    RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}
    This works for me, it could help any other
    I'll check that out when i wake up in the morning and add it if it fits and works

    Leave a comment:


  • chriske
    replied
    How can I rewrite the url that it becomes like this:
    forum/f24/vbulletin-t8803.html

    Leave a comment:


  • scsa20
    replied
    Hmm... I tired both NavS and Matty Asia's codes for the mod rewrites and both gives me the same issue of creating a thread where I get a 404 error page when creating a new thread even though the thread does get created. The ending address is /forums/3-Test-post-2?p=3#post3

    Leave a comment:


  • Yves Rigaud
    replied
    You can add one more rule. This rule is for the 'Configure' link into the widget manager (admincp).

    Code:
    RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}
    This works for me, it could help any other

    Leave a comment:


  • Lord Osirus
    replied
    Worked perfect.

    Originally posted by MattyAsia View Post
    There is no .htaccess to support the "Mod Rewrite Friendly URLs", so I have one written below, the first 3 are just a little beta bug proofing.

    I can not guarantee this is perfect, but it's working so far, if I find any bugs, I'll squish em and edit in an updated version

    Code:
    # Author: Matty Asia
    # Version 1.4
    # Downloaded from: http://www.vbulletin.com/forum/showthread.php?325798
    
    RewriteEngine On
    
    ### THIS IS A LITTLE EXTRA SECURITY AND CAN BE REMOVED
    
    RewriteRule ^includes/(.*) index.php
    RewriteRule ^vb/(.*) index.php
    RewriteRule ^packages/(.*) index.php
    
    ### THIS IS THE ACTUAL REWRITE
    
    RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
    RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
    RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
    To use this you must have Mod Rewrite Friendly URLs enabled.

    To do this...
    You need to go to Admin Control Panel then Settings > Options
    Server Settings and Optimization Options
    Then select Mod Rewrite Friendly URLs in the Friendly URLs section.

    UPDATES:
    1.4 Fixed content editing for CMS sections without SEO friendly names

    If you get Error 500, check the .htaccess file for any \n hidden anywhere as seems to have appeared for a number of users copying from here, see the quote just below. Make sure what you copy is identical to what you see above.

    Leave a comment:


  • MattyAsia
    replied
    Originally posted by FF|Skyrider View Post
    Curious. I noticed that the mod rewrite rules adds a /thread/ before the link, eg
    http://forum.mysite.com/threads/6379-my-post-is-awesome

    Is it possible it can be changed to something like this?
    http://forum.mysite.com/my-post-is-awesome-t6379.html

    I like that one much better.
    Not possible through rewrites, I mean I could make it read from something like that... in theory, however, I you'd need to change vBulletin too to open it in such a fashion, way too much work. If your goal is just to make "http://forum.mysite.com/my-post-is-awesome-t6379.html" go to "http://forum.mysite.com/threads/6379-my-post-is-awesome" because of something like vbSEO, that's possible and not so hard.

    Originally posted by FF|Skyrider View Post
    EDIT!
    At the post creator. Using that mod rewrite rules makes you unable to create front page articles. It brings you back to the front page with the link of creating a new article.
    Are you using the latest version I've written, check the number and see if it's v 1.4 (as written at the top of the file), it used to have that problem, but I fixed it.

    Leave a comment:


  • MattyAsia
    replied
    Originally posted by Alfa1 View Post
    Originally posted by Pehchaan View Post
    It seems neither of these 2 actually support it. Writing the Rewrite is only a small part of the battle. I could write something that would do things like
    http://www.site.com/albums/123-album-name
    But vBulletin would still not actually link to it at all.

    Leave a comment:


  • Veer
    replied
    also I need this:
    http://www.site.com/albums/album-name

    Leave a comment:


  • Alfa1
    replied
    so how would I get:

    http://www.site.com/groups/group-name

    Leave a comment:


  • Skyrider
    replied
    Curious. I noticed that the mod rewrite rules adds a /thread/ before the link, eg
    http://forum.mysite.com/threads/6379-my-post-is-awesome

    Is it possible it can be changed to something like this?
    http://forum.mysite.com/my-post-is-awesome-t6379.html

    I like that one much better.

    EDIT!
    At the post creator. Using that mod rewrite rules makes you unable to create front page articles. It brings you back to the front page with the link of creating a new article.
    Last edited by Skyrider; Tue 17 Nov '09, 6:14am.

    Leave a comment:


  • snerd
    replied
    Originally posted by NavS View Post
    Code:
    # Author: Matty Asia
    # Version 1.4
    # Downloaded from: http://www.vbulletin.com/forum/showthread.php?325798
    
    RewriteEngine On
    
    ### THIS IS A LITTLE EXTRA SECURITY AND CAN BE REMOVED
    
    RewriteRule ^includes/(.*) index.php
    RewriteRule ^vb/(.*) index.php
    RewriteRule ^packages/(.*) index.php
    
    ### THIS IS THE ACTUAL REWRITE
    [COLOR=Red]
    RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}[/COLOR] 
    RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
    [COLOR=Red]RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}[/COLOR]
    RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
    RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
    adding any one of those breaks the whole website for me.

    i searched and this works for me now:

    Code:
    RewriteEngine On
    RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
    RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
    RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
    RewriteRule ^threads/([0-9]+)-(.*)? showthread.php?t=$1 [QSA,L]
    RewriteRule ^members/([0-9]+)-(.*)? member.php?u=$1 [QSA,L]
    RewriteRule ^forums/([0-9]+)-(.*)? forumdisplay.php?f=$1 [QSA,L]
    Thanks, this works for me also.

    Leave a comment:


  • Veer
    replied
    Can we also have friendly urls for social groups and albums?

    Leave a comment:


  • Mandar Salvi
    replied
    Works perfect for me Thank you very much!

    Leave a comment:


  • lucky89
    replied
    Works perfect for me... great work

    Leave a comment:


  • NavS
    replied
    Code:
    # Author: Matty Asia
    # Version 1.4
    # Downloaded from: http://www.vbulletin.com/forum/showthread.php?325798
    
    RewriteEngine On
    
    ### THIS IS A LITTLE EXTRA SECURITY AND CAN BE REMOVED
    
    RewriteRule ^includes/(.*) index.php
    RewriteRule ^vb/(.*) index.php
    RewriteRule ^packages/(.*) index.php
    
    ### THIS IS THE ACTUAL REWRITE
    [COLOR=Red]
    RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}[/COLOR] 
    RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
    [COLOR=Red]RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}[/COLOR]
    RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
    RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
    adding any one of those breaks the whole website for me.

    i searched and this works for me now:

    Code:
    RewriteEngine On
    RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
    RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
    RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
    RewriteRule ^threads/([0-9]+)-(.*)? showthread.php?t=$1 [QSA,L]
    RewriteRule ^members/([0-9]+)-(.*)? member.php?u=$1 [QSA,L]
    RewriteRule ^forums/([0-9]+)-(.*)? forumdisplay.php?f=$1 [QSA,L]
    Last edited by NavS; Mon 16 Nov '09, 5:08pm.

    Leave a comment:

Related Topics

Collapse

Working...
X