mod_rewrite

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • PipSqueak
    Sergeant

    • Aug 2005
    • 23

    mod_rewrite

    does your server have mod_rewrite enabled?

    I have a site that's using a template given by an affiliate program I joined. That template uses meds.php?src=123 which is not search engine friendly. With mod rewrite, I can change the link to keyword.html which scores better with the search engines.

    Here's a sample of the code which I want to use in my .htaccess:
    RewriteEngine on
    RewriteRule ^zenegra_sildenafil_citrate.html$ meds.php?id=&srch=21
  • VodaHost
    General & Forum Administrator

    • Mar 2005
    • 12356

    #2
    try it.

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    02036089024 / United Kingdom
    291916438 / Australia

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


    Comment

    • PipSqueak
      Sergeant

      • Aug 2005
      • 23

      #3
      I did try it. It didn't work. I need a confirmation so that I'll know whether it's my script that's not working, or you didn't enable it.

      Comment

      • deepak
        Members

        • May 2005
        • 17

        #4
        vodahost has mod_rewrite. I use drupal for my site, and use mod_rewrite to solve the ?= thing in php driven pages and also aliases in drupal.

        Deepak

        Comment

        • PipSqueak
          Sergeant

          • Aug 2005
          • 23

          #5
          Thanks for your reply, Deepak! You are very helpful! :)

          Comment

          • PipSqueak
            Sergeant

            • Aug 2005
            • 23

            #6
            Need help.

            Well, I tried this:

            Code:
            Options +FollowSymLinks
             RewriteEngine On
             RewriteRule ^zenegra_sildenafil_citrate\.html$ meds.php?srch=21
             RewriteRule ^generic_*******\.html$ meds.php?srch=22
            for my site at http://www.staywealthy.com/pharmacy/

            It didn't work. Any ideas?

            The .htaccess file is kept in the pharmacy directory.

            Comment

            • deepak
              Members

              • May 2005
              • 17

              #7
              Originally posted by PipSqueak
              Well, I tried this:

              Code:
              Options +FollowSymLinks
               RewriteEngine On
               RewriteRule ^zenegra_sildenafil_citrate\.html$ meds.php?srch=21
               RewriteRule ^generic_*******\.html$ meds.php?srch=22
              for my site at http://www.staywealthy.com/pharmacy/

              It didn't work. Any ideas?

              The .htaccess file is kept in the pharmacy directory.
              Sorry, I don't know how it exactly works, Drupal does it automatically. This is the thing on my .htaccess file

              RewriteEngine On
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

              I have no clue what it does. There is a very good (and long) guide on this

              This article was written in 2002 and remains one of our most popular posts. If you’re keen to learn more about URLs, you may find this recent article on the “www” prefix, by Craig Buckler, of great interest.


              this might be of some help for you.

              -Deepak

              PS: did you use bluevoda for your site? its layout is good. Maybe i should try bluevoda anyway.

              Comment

              • PipSqueak
                Sergeant

                • Aug 2005
                • 23

                #8
                PS: did you use bluevoda for your site? its layout is good. Maybe i should try bluevoda anyway.
                Hmm, I can't seem to get the rewrite to work. Anyway, the site isn't made using bluevoda. It's actually a template I got from my merchant.

                Comment

                • PipSqueak
                  Sergeant

                  • Aug 2005
                  • 23

                  #9
                  I tried this from rewriterule generator:


                  Options +FollowSymLinks
                  RewriteEngine on
                  RewriteRule zenegra(.*)\.htm$ /pharmacy/meds.php?srch=$1


                  and this:


                  Options +FollowSymLinks
                  RewriteEngine on
                  RewriteRule ^meds/([A-Za-z0-9-]+)\.htm$ http://staywealthy.com/pharmacy/meds.php?srch=$1 [L]


                  But none worked. Would really really appreciate some help!


                  :(

                  Comment

                  • deepak
                    Members

                    • May 2005
                    • 17

                    #10
                    I will try it out next week and let you know.

                    Could you post exactly what is needed.
                    i.e your present url and the rewritten one
                    and also your .htaccess files, post al .htaccess files in the folder path.

                    If you want to send it, mail it to my forum username [at] i386 dot net

                    -Deepak

                    Comment

                    • PipSqueak
                      Sergeant

                      • Aug 2005
                      • 23

                      #11
                      Originally posted by deepak
                      I will try it out next week and let you know.

                      Could you post exactly what is needed.
                      i.e your present url and the rewritten one
                      and also your .htaccess files, post al .htaccess files in the folder path.

                      If you want to send it, mail it to my forum username [at] i386 dot net

                      -Deepak
                      Hi Deepak,

                      My site - http://www.staywealthy.com/pharmacy - is using dynamic links (http://www.staywealthy.com/pharmacy/meds.php?srch=21) and I want to change it to static links (http://www.staywealthy.com/pharmacy/zenegra.html).

                      I put my .htaccess file in my "pharmacy" directory. My .htaccess file is currently using the codes below which isn't working.

                      Code:
                       Options +FollowSymLinks 
                       RewriteEngine on 
                       RewriteRule ^meds/([A-Za-z0-9-]+)\.htm$ [url="http://www.webmasterworld.com/ra.cgi?f=88&d=10064&url=http://domain.com/pills/meds.php?srch=$1"]http://staywealthy.com/pharmacy/meds.php?srch=$1[/url]  [L]

                      Comment

                      Working...
                      X