Drupal 6 Clean URL configuration on Windows XP and Apache 2.2(依此實現Clean URL)

來源:互聯網
上載者:User

http://drupal.org/node/399310

 

  1. Enter Apache 2.2 conf directory:

    > cd C:\Program Files\Apache Software Foundation\Apache2.2\conf
  2. Open httpd.conf> notepad httpd.conf
  3. Uncomment loading of read-write module by removing #:LoadModule rewrite_module modules/mod_rewrite.so
  4. Uncomment including virtual hosts delaration file by removing #:# Virtual hosts
    Include conf/extra/httpd-vhosts.conf
  5. For declaring only localhost
    1. create or clear contents of file conf/extra/httpd-vhosts.conf
    2. Copy and paste the following in this file:<Directory />
          Options FollowSymLinks
          AllowOverride All
          Order deny,allow
          Deny from all
          Satisfy all
      </Directory>

      <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
          Options Indexes FollowSymLinks
          AllowOverride All
          Order allow,deny
          Allow from all

          RewriteEngine on
          RewriteBase /
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      </Directory>

      # Use name-based virtual hosting.
      NameVirtualHost 127.0.0.1

      <VirtualHost 127.0.0.1>
         DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
         ServerName localhost
         DirectoryIndex index.php
      </VirtualHost>

Jeff in Seattle

» Login or register to post comments

Very helpful guideshaunak - March 13, 2009 - 12:05

Very helpful post.

I would also like to add that you also may have to set the "AllowOverride" directive to "All" [around line 224 in the httpd.conf file] to allow directives in the .htaccess to work.

 

around that line, you can see,

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
    Satisfy all
</Directory>

--
Cheers,
shaunak.

Login or register to post commentsThanksdmartin - August 13, 2009 - 18:06

@shaunak
Thanks so much. I've tried everything under the sun, and it didn't work. Your post led me to this in my httpd.conf:

Options FollowSymLinks
AllowOverride None

Which was overridding every single thing I tried, and I didn't even know it. As soon as I changed None to All, boom, it was working.

 在上述設定完成後,再進行以下兩步:

(1)"開始"--"程式"--"Apache HTTP Server 2.2.6"--"Control Apache Server"--"Restart"

 

(2)  開啟IE瀏覽器,pointer to http://127.0.0.1/drupal/

    "Administrater"--"site configure" --"Clean URLs"--選Enable

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.