Announcement

Collapse
No announcement yet.

Mod Rewrite Friendly URLs => .htaccess

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

  • audiokid
    replied
    first rewrite works for me , thanks!

    which one is best?

    Leave a comment:


  • omegatron
    replied
    That did not work for me but this does

    Code:
    RewriteEngine on
    Options +FollowSymLinks
    
    #RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    #RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
    
    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}

    Leave a comment:


  • Veer
    replied
    Working fine for me, thanks.

    Leave a comment:


  • Fr4n-FX
    replied
    thx matty asia im testing too

    Leave a comment:


  • snerd
    replied
    Originally posted by sifuhall View Post
    check your error logs.

    what is the actual error?
    Well, looks like it's getting munged and the line is not complete:

    RewriteRule: cannot compile regular expression '^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?))'\n
    That '\n is appearing when I copy to the .htaccess for some reason.

    Leave a comment:


  • sifuhall
    replied
    check your error logs.

    what is the actual error?

    Leave a comment:


  • snerd
    replied
    I'm on a shared server, but have used vBseo .htaccess for rewriting on old version. This .htaccess just gets the internal server error.

    Leave a comment:


  • AWS
    replied
    If you use IIS add

    $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
    to the top of class_core.php.

    Leave a comment:


  • Yves Rigaud
    replied
    Great code, thank you

    Leave a comment:


  • nubian
    replied
    Works flawlessly for me on my local environment.
    Thanks!
    Last edited by nubian; Sun 15 Nov '09, 7:22am.

    Leave a comment:


  • Darkimmortal
    replied
    For some reason these don't work on nginx (basic conversions applied obviously) - must be something weird about the regexes :/

    Leave a comment:


  • MattyAsia
    replied
    Originally posted by sifuhall View Post
    Seems to be working well for me.

    Thanks for posting this.
    No problem, but keep checking back, I keep finding small issues and updating them, you can tell if yours is up to date via the version number.

    Leave a comment:


  • sifuhall
    replied
    Seems to be working well for me.

    Thanks for posting this.

    Leave a comment:


  • MattyAsia
    replied
    Originally posted by snerd View Post
    No work here either, 500 Internal Server Error
    Have you done rewrites before?
    In httpd.conf make sure
    #LoadModule rewrite_module modules/mod_rewrite.so
    is
    LoadModule rewrite_module modules/mod_rewrite.so

    then restart apahce.

    Leave a comment:


  • snerd
    replied
    No work here either, 500 Internal Server Error

    Leave a comment:

Related Topics

Collapse

Working...
X