Simple mod_rewrite question

Discussion in 'Apache' started by tomupton, Jul 29, 2012.

  1. #1
    Hi Guy's,

    Ive been working on this all night and im hoping someone can help here!

    Below is my .htaccess file, what im trying to achieve is that certain pages within my site are dynamically created, so for example my urls are looking like this:

    http://localhost/SkinProject/Wrinkles

    The problem is some of my standard pages (no dynamic) are displayed like this - http://localhost/SkinProject/contact.php - as you can see they have an extension of .php at the end.

    What i would ideally like is to have this url end in .php - http://localhost/SkinProject/Wrinkles.php

    Below is my code, any help would be fab!
    Regards
    Tom

    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /

    RewriteRule ^([A-Z­a-z­0-9­-]+)/?$ SkinProject/page.php?seo_link=$1 [L]
     
    tomupton, Jul 29, 2012 IP
  2. Ray Baron

    Ray Baron Member

    Messages:
    148
    Likes Received:
    10
    Best Answers:
    3
    Trophy Points:
    43
    #2
    Caveat: I have not tried this, but I think you can get you where you want to go from here:

    RewriteRule ^([^.]*[^./])$ $1.php [L]
     
    Ray Baron, Aug 8, 2012 IP
  3. lightningbolt

    lightningbolt Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Let me try and see if i can help.
     
    lightningbolt, Aug 8, 2012 IP