SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2011
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    URL rewrite syntax

    I've just been having a look at this, and have gotten halfway to what I would like to do.

    So I've got it working by changing my .htaccess file to include:

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule index/LodgeID/(.*)/ index.php?LodgeID=$1
    RewriteRule index/LodgeID/(.*) index.php?LodgeID=$1

    Which, for example, is rewriting:

    http://lodges.goodsafariguide.com/lodgedetails/index.php?LodgeID=288

    To:

    http://lodges.goodsafariguide.com/lodgedetails/index/LodgeID/288/

    And I've resolved the issue of my paths to images and CSS files going AWOL.

    What I would like to be able to do is include a variant of the lodge name in the URL.

    I do have a field in the lodges table which has a short name string which could be used, e.g.:

    africanhorsebacksafaris

    Is it possible to use rewrite the URL to:

    http://lodges.goodsafariguide.com/lodgename/

    Where 'lodgename' is stored as a field in the same lodges table as LodgeID?

    Hope that makes sense. Thanks.
    Last edited by Mittineague; Nov 23, 2013 at 19:03. Reason: delinking example URLs


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
  •