Question about custom links (mod Rewrite)

Discussion in 'Search Engine Optimization' started by Guernica, Aug 6, 2008.

  1. #1
    I used this for my website to try and make better looking links and have it turn up better on search engines, etc.

    However, when I made links like this:

    resource.php?g=1942&p=maps

    go to something like this:

    resources/1942/maps/

    ... Images and things did not show up correctly. I have these set in my php fields on my website so how can it bring all images from the main public_html/images directory and not make it resources/1942/maps/images ?

    Thanks for any help!
     
    Guernica, Aug 6, 2008 IP
  2. SEMSpot

    SEMSpot Peon

    Messages:
    513
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    SEMSpot, Aug 6, 2008 IP
  3. Guernica

    Guernica Peon

    Messages:
    268
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hmmm, I was thinking about that as I was posting this actually, only thing is I have to go through all my templates and change it.

    I guess what I'll do is make a constant in global.php and make that in front of all images. =/ Thanks.

    Edit:

    Hmmm I seem to have forgotten how to do these, this isn't how it goes?

    RewriteEngine on
    RewriteRule ^/videos/$ /videos.php [NC]
    Code (markup):
     
    Guernica, Aug 6, 2008 IP
  4. supersan

    supersan Well-Known Member

    Messages:
    245
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    108
    #4
    You will have to use mod_rewrite for that..

    
    RewriteEngine on
    RewriteRule ^/resources/(.*) /resources.php?$1 [L]
    
    Code (markup):
    i'm not 100% sure of the syntax but this is how i did that once
     
    supersan, Aug 6, 2008 IP
  5. Guernica

    Guernica Peon

    Messages:
    268
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Guernica, Aug 6, 2008 IP
  6. Rituja

    Rituja Peon

    Messages:
    539
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Rituja, Aug 6, 2008 IP
  7. Bloomtools

    Bloomtools Peon

    Messages:
    1,361
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #7
    try this one
    ======= BEGIN ==============================================
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^letter/(.)/(.*)/$ letter/$1/$2/page-1/ [L]
    RewriteRule ^letter/(.)/$ letter/$1/page-1/ [L]
    ======= END ================================================
     
    Bloomtools, Aug 6, 2008 IP