Results 1 to 11 of 11

Thread: mod_rewrite
      
   

  1. #1
    PipSqueak is offline Sergeant
    Join Date
    Aug 2005
    Posts
    23

    Default 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

  2. #2
    VodaHost's Avatar
    VodaHost is offline General & Forum Administrator
    Join Date
    Mar 2005
    Location
    Wilmington, Delaware USA
    Posts
    11,428

    Default

    try it.

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    07031847328 / United Kingdom

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

    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)



  3. #3
    PipSqueak is offline Sergeant
    Join Date
    Aug 2005
    Posts
    23

    Cool

    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.

  4. #4
    deepak is offline Members
    Join Date
    May 2005
    Posts
    17

    Default

    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

  5. #5
    PipSqueak is offline Sergeant
    Join Date
    Aug 2005
    Posts
    23

    Default

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

  6. #6
    PipSqueak is offline Sergeant
    Join Date
    Aug 2005
    Posts
    23

    Question Need help.

    Well, I tried this:

    Code:
    Options +FollowSymLinks
     RewriteEngine On
     RewriteRule ^zenegra_sildenafil_citrate\.html$ meds.php?srch=21
     RewriteRule ^generic_levitra\.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.

  7. #7
    deepak is offline Members
    Join Date
    May 2005
    Posts
    17

    Default

    Quote Originally Posted by PipSqueak
    Well, I tried this:

    Code:
    Options +FollowSymLinks
     RewriteEngine On
     RewriteRule ^zenegra_sildenafil_citrate\.html$ meds.php?srch=21
     RewriteRule ^generic_levitra\.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

    http://www.sitepoint.com/article/guide-url-rewriting

    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.

  8. #8
    PipSqueak is offline Sergeant
    Join Date
    Aug 2005
    Posts
    23

    Default

    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.

  9. #9
    PipSqueak is offline Sergeant
    Join Date
    Aug 2005
    Posts
    23

    Default

    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!


    :(

  10. #10
    deepak is offline Members
    Join Date
    May 2005
    Posts
    17

    Default

    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

  11. #11
    PipSqueak is offline Sergeant
    Join Date
    Aug 2005
    Posts
    23

    Default

    Quote 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$ http://staywealthy.com/pharmacy/meds.php?srch=$1  [L]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49