Help with url rewriting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LeftBrainStudio
    Junior Member
    • Mar 2004
    • 21

    #1

    Help with url rewriting

    I can't figure out why my url rewriting isn't working. Please help.

    I have an .htaccess file in /public_html that contains the following:
    Code:
    Options +FollowSymLinks All
    RewriteEngine on
    
    RewriteRule work/(.*) work.php?piece=$1
    I'm trying to get:
    domain.com/work.php?piece=name
    to rewrite as:
    domain.com/work/name

    Any thoughts?
  • LeftBrainStudio
    Junior Member
    • Mar 2004
    • 21

    #2
    Ok, I figured it out. I ended up having to write it as:

    Code:
    Options +FollowSymLinks All
    RewriteEngine on
    
    RewriteRule ^work-(.*)$ work.php?piece=$1
    For some reason I couldn't get the directory display method to work (i.e.: work/piece).

    Comment

    • ZYV
      Senior Member
      • Sep 2005
      • 315

      #3
      I have literally this on one of my sites:

      RewriteEngine on

      # News archive
      RewriteRule ^(rus|eng)/news/$ news.php?lng=$1 [L,QSA]

      # Download center
      RewriteRule ^(rus|eng)/download/$ download/?lng=$1 [L,QSA]
      RewriteRule ^(rus|eng)/download/([a-z]+\.php)$ download/$2?lng=$1 [L,QSA]

      # Feedback script
      RewriteRule ^(rus|eng)/dialog/feedback/$ feedback.php?lng=$1 [L,QSA]
      .. and I swear that it IS working

      Comment

      Working...