Simple removal from all URL's

Discussion in 'Apache' started by HighRankingSEO, Jun 8, 2010.

  1. #1
    All my page URL's are something like:

    whatever.com/?p=pagetitle

    I would like them to be:
    whatever.com/pagetitle/

    Can someone give me the rewrite for that...I tried a couple different things and just keep getting errors...I thought this was a simple replacement....any help would be awesome. Thanks in advance.
     
    HighRankingSEO, Jun 8, 2010 IP
  2. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #2
    It should be something like this:

    
    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^/([^/]+)/$ /?p=$1 [L]
    
    Code (markup):
    Please note that this will forward every subfolder to that specific url, so even if you had some whatever.com/contact/ it will be also forwarded to whatever.com?p=contact . I guess that's the bad side of this rule.
     
    pr0t0n, Jun 13, 2010 IP