SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Threaded View

  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    844
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question about pretty URLs

    This URL works perfectly in that the URL does not change in the address bar:

    http://www.oil-testimonials.com/essential-oils/7484/

    Recently I have been working on a facelift for my website, so I put all the needed files into a directory called newVersion. Now when I go to this URL:

    http://www.oil-testimonials.com/newVersion/essential-oils/7484

    Somehow the URL is no longer pretty and reverts back to the ugly format:

    http://www.oil-testimonials.com/newVersion/essential-oils.php?tID=7484

    Here are the relevant lines in my .htaccess file:

    RewriteRule ^essential-oils/([0-9]+)$ http://www.oil-testimonials.com/newVersion/essential-oils.php?tID=$1 [L]
    RewriteRule ^essential-oils/([0-9]+)/$ http://www.oil-testimonials.com/newVersion/essential-oils.php?tID=$1 [L]
    RewriteRule ^essential-oils/([0-9]+)/([a-zA-Z0-9\+]+)$ http://www.oil-testimonials.com/newVersion/essential-oils.php?tID=$1&q=$2 [L]

    Does anyone know whey I have to use the full path otherwise the RewriteRule does not work? Does it have anything to do with the fact that I'm running this .htaccess file from within a subdirectory instead of from the root?

    Thanks!
    Last edited by Stevie D; Jul 19, 2012 at 15:40. Reason: URLs delinked
    Convert your dollars into silver coins. www.convert2silver.com


Bookmarks

Posting Permissions

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