Announcement

Collapse
No announcement yet.

Mod Rewrite Friendly URLs => .htaccess

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

  • #16
    Working fine for me, thanks.

    Comment


    • #17
      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}

      Comment


      • #18
        first rewrite works for me , thanks!

        which one is best?
        Cheers!

        RECORDING ORG
        created for musicians, by musicians

        Comment


        • #19
          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)

          Comment


          • #20
            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?

            Comment


            • #21
              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.
              snerd

              Comment


              • #22
                Both work for me fine.

                Comment


                • #23
                  Its possible your webhost does not allow you to use mod_rewrite rules.

                  Comment


                  • #24
                    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;
                    vB4 SuperCharged
                    http://www.gamingmasters.co.uk

                    Comment


                    • #25
                      OP code worked fine for me - thank you MattyAsia
                      Don't forget to thank your helpers by clicking on the http://www.vbulletin.com/forum/image...tation-40b.png icon in the post footer!

                      TeamSport90.com Grass Roots Football Forum
                      TeamSport90.com Football Kits

                      Comment


                      • #26
                        sorry nobe question

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

                        Comment


                        • #27
                          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)

                          Comment


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

                            Comment


                            • #29
                              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>
                              Translations provided by Google.

                              Wayne Luke
                              The Rabid Badger - a vBulletin Cloud demonstration site.
                              vBulletin 5 API - Full / Mobile
                              Vote for your favorite feature requests and the bugs you want to see fixed.

                              Comment


                              • #30
                                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.
                                vB4 SuperCharged
                                http://www.gamingmasters.co.uk

                                Comment

                                Related Topics

                                Collapse

                                Working...
                                X