Announcement

Collapse
No announcement yet.

Mod Rewrite Friendly URLs => .htaccess

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

  • IanR
    replied
    Works a treat for me, thanks a lot!

    Leave a comment:


  • Wayne Luke
    replied
    Originally posted by Charlie_Brown View Post
    Wayne would that go into the .htaccess file?
    That would go into your web.config file if you're using IIS 7 or higher.

    Leave a comment:


  • Charlie_Brown
    replied
    Wayne would that go into the .htaccess file?

    Leave a comment:


  • Darkimmortal
    replied
    Originally posted by testebr View Post
    And about 301 redirectrules for old urls? We do not want to lose google ranking.
    I'm pretty sure vB handles that automatically.

    Leave a comment:


  • Wayne Luke
    replied
    I converted MattyAsia's .htaccess file to a web.config file that can be used for IIS 7 or higher and Microsoft's URL Rewrite module. However I have not had a chance to test it yet. You are welcome to test it.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="Imported Rule 1">
                        <match url="^includes/(.*)" ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />
                    </rule>
                    <rule name="Imported Rule 2">
                        <match url="^vb/(.*)" ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />
                    </rule>
                    <rule name="Imported Rule 3">
                        <match url="^packages/(.*)" ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />
                    </rule>
                    <rule name="Imported Rule 4">
                        <match url="^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?))" ignoreCase="false" />
                        <action type="Rewrite" url="showthread.php?t={R:1}&amp;page={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
                    </rule>
                    <rule name="Imported Rule 5">
                        <match url="^members/([0-9]+)" ignoreCase="false" />
                        <action type="Rewrite" url="member.php?u={R:1}&amp;{QUERY_STRING}" appendQueryString="false" />
                    </rule>
                    <rule name="Imported Rule 6">
                        <match url="^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?))" ignoreCase="false" />
                        <action type="Rewrite" url="forumdisplay.php?f={R:1}&amp;page={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
                    </rule>
                    <rule name="Imported Rule 7">
                        <match url="^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?))" ignoreCase="false" />
                        <action type="Rewrite" url="blog.php?u={R:1}&amp;page={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
                    </rule>
                    <rule name="Imported Rule 8">
                        <match url="^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?))" ignoreCase="false" />
                        <action type="Rewrite" url="entry.php?b={R:1}&amp;page={R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
                    </rule>
                    <rule name="Imported Rule 9">
                        <match url="^list/([^/]*/)([0-9]+)" ignoreCase="false" />
                        <action type="Rewrite" url="list.php?r={R:1}{R:2}&amp;{QUERY_STRING}" appendQueryString="false" />
                    </rule>
                    <rule name="Imported Rule 10">
                        <match url="^content/(.*)" ignoreCase="false" />
                        <action type="Rewrite" url="content.php?r={R:1}&amp;{QUERY_STRING}" appendQueryString="false" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>

    Leave a comment:


  • testebr
    replied
    And about 301 redirectrules for old urls? We do not want to lose google ranking.

    Leave a comment:


  • Skyrider
    replied
    Originally posted by baghdad4ever View Post
    sorry nobe question

    what should this code do? i apply it to my arabic forum and nothing occur
    This code goes in combination with the SEO settings that enables Friendly URL's. You add the code that the thread creator created in your htaccess file located in the root of your forum files (if it isn't there, create one)

    Leave a comment:


  • baghdad4ever
    replied
    sorry nobe question

    what should this code do? i apply it to my arabic forum and nothing occur

    Leave a comment:


  • teamsport90
    replied
    OP code worked fine for me - thank you MattyAsia

    Leave a comment:


  • Darkimmortal
    replied
    Nginx rewrites:

    Code:
            rewrite entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&$query_string;
            rewrite threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&$query_string;
            rewrite members/([0-9]+) member.php?u=$1&$query_string;
            rewrite forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&$query_string;
            rewrite blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&$query_string;
            rewrite list/([^/]*/)([0-9]+) list.php?r=$1$2&$query_string;
            rewrite content/(.*) content.php?r=$1&$query_string;

    Leave a comment:


  • Zachery
    replied
    Its possible your webhost does not allow you to use mod_rewrite rules.

    Leave a comment:


  • kuyenmotdivad
    replied
    Both work for me fine.

    Leave a comment:


  • snerd
    replied
    Originally posted by smirkley View Post
    First one gives 500 server error.

    Mod Rewrite is fully installed on my VPS.

    Looking for confirmation on second entry above before I bother trying.


    (really really wanting vB input on this, at least by next beta release)
    I got same 500 internal error with second one too.

    Leave a comment:


  • Charlie_Brown
    replied
    Both give my 500 errors but that might be I am on a test forum that you have to log in to get to the forum first?

    Leave a comment:


  • smirkley
    replied
    First one gives 500 server error.

    Mod Rewrite is fully installed on my VPS.

    Looking for confirmation on second entry above before I bother trying.


    (really really wanting vB input on this, at least by next beta release)

    Leave a comment:

Related Topics

Collapse

Working...
X