Clean URLs in Drupal - how do they work?

Discussion in 'Drupal' started by Red Paul, Jan 14, 2008.

  1. #1
    I've enabled 'clean urls' in my 'absolute beginner' drupal site, but still see urls in the form ?q=node/14

    The Drupal help text says... This option makes Drupal emit "clean" URLs (i.e. without ?q= in the URL.)

    What am I doing wrong??

    Thanks,
    RP
     
    Red Paul, Jan 14, 2008 IP
  2. theone2003a

    theone2003a Member

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    There is an option in drupal that makes urls SEO friendly. (Just choose it and thats all)
     
    theone2003a, Jan 15, 2008 IP
  3. Red Paul

    Red Paul Peon

    Messages:
    115
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That was the point... I chose it and there's no obvious change to URLs!
     
    Red Paul, Jan 15, 2008 IP
  4. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Are you using IIS? I don't know Drupal but I do know that a lot of SEF URLs are implemented for Apache only.
     
    TwistMyArm, Jan 15, 2008 IP
  5. Petey

    Petey Peon

    Messages:
    68
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi Red Paul,

    TwistMyArm is right, the standard URL rewriting for Drupal uses the apache mod_rewrite to automagically remove the '?q=' portion of the url.

    If you are using apache:
    1) Check that the LoadModule and AddModule commands in your httpd.conf file are uncommented.

    2) Check that the .htaccess file for your drupal site includes this:
    <IfModule mod_rewrite.c>
    RewriteEngine on

    # Rewrite current-style URLs of the form 'index.php?q=x'.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    </IfModule>

    HTH

    Petey
     
    Petey, Jan 15, 2008 IP
  6. Bohol

    Bohol Peon

    Messages:
    2,680
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi Petey, is that mod rewrite applicable in SMF, too?
     
    Bohol, Jan 15, 2008 IP
  7. Red Paul

    Red Paul Peon

    Messages:
    115
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks Petey, that was the sort of thing I was after! I'll check it out and see if it cures the problem. :)
     
    Red Paul, Jan 15, 2008 IP
  8. Petey

    Petey Peon

    Messages:
    68
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Petey, Jan 15, 2008 IP
  9. Bohol

    Bohol Peon

    Messages:
    2,680
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You can ask your host if configuring Drupal clean URLs is supported. I use Drupal now and I applied the clean urls without any bumps.
     
    Bohol, Mar 1, 2008 IP