Any Mod Rewrite Gurus here?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheJimmy
    ICQ- five seven 0 2 5 5 0
    • Jan 2001
    • 10747

    #1

    Any Mod Rewrite Gurus here?

    RewriteEngine on
    Options +FollowSymlinks
    RewriteBase /
    RewriteRule ^\tata.html$ /file.html




    how do I get the 'tata' part to wildcard?





    a friend asked me and I'm one stumped mofo....





    thanks in advance....
    Investor with 5m - 15m USD to invest. Do you have a site or network of sites earning 50k - 200k a month income? Email your contact and preliminary data to: domain.cashventures (at) gmail.com....Please...no tire kickers...serious offers and inquiries only.
  • hudson
    Confirmed User
    • Jul 2003
    • 2948

    #2
    RewriteEngine on
    Options +FollowSymlinks
    RewriteBase /
    RewriteRule ^\tata.html$ /file.html

    OK, on the RewriteBase part, you got to put your subdirectory
    RewriteBase /sub1/

    Then

    RewriteRule ^tata.html$ file.html

    should work...but I would have to test it...you just want to rewrite tata.html to file.html, correct?

    Comment

    • Wiz
      Confirmed User
      • Dec 2002
      • 223

      #3
      Not sure but ...

      RewriteEngine on
      Options +FollowSymlinks
      RewriteBase /
      RewriteRule ^(.*)\.html$ file.html

      If you want the wildcard before the .html part ;)
      !

      Comment

      • hudson
        Confirmed User
        • Jul 2003
        • 2948

        #4
        Originally posted by Wiz
        Not sure but ...

        RewriteEngine on
        Options +FollowSymlinks
        RewriteBase /
        RewriteRule ^(.*)\.html$ file.html

        If you want the wildcard before the .html part ;)
        that would make any html file rewrite to file.html

        Comment

        • Wiz
          Confirmed User
          • Dec 2002
          • 223

          #5
          Thats what the guy asked it seem .. hehe
          !

          Comment

          • DerekT
            Confirmed User
            • Jun 2001
            • 112

            #6
            Try this:

            RewriteEngine On
            Options -indexes
            RewriteRule ^(.*).html$ /DIRECTORY/$1.html [L]

            Replace DIRECTORY with a sub. If you do this:
            RewriteRule ^(.*).html$ /$1.html [L]
            It would create a loop and fail.

            Or for a dynamic solution:
            RewriteRule ^(.*).html$ /view.php?cat=$1 [L]

            Creating a file called view.php to accept variables would then do this:
            /free-sex-pics.html would translate to /view.php?cat=free-sex-pics

            You could then have the view.php create a page with titles, alt tags, headers, etc for search engines.

            Hope it helps.

            Comment

            • DerekT
              Confirmed User
              • Jun 2001
              • 112

              #7
              http://httpd.apache.org/docs/mod/mod_rewrite.html

              Here is another good page, but a long read.

              Comment

              • Wiz
                Confirmed User
                • Dec 2002
                • 223

                #8
                DerekT , thanks for the php part and variable ;)
                !

                Comment

                • DerekT
                  Confirmed User
                  • Jun 2001
                  • 112

                  #9
                  No problem. I had a project a while back to create a totaly dynamic sex toy store. I took their entire spread sheet, imported it to MySQL, create custom php, download all the images and thumbnails. Walah, a toy store, with search engine friendly pages numbering over 15,000 products. The sweetness of it is when there are changes in the search engines, I can tweak just two files and all the products are updated to rank better.

                  Comment

                  • Wiz
                    Confirmed User
                    • Dec 2002
                    • 223

                    #10
                    yup the best way ;)
                    !

                    Comment

                    Working...