Drupal 6 Clean URL configuration on Windows XP and Apache 2.2(依此实现Clean URL)

 2023-02-26    430  

http://drupal.org/node/399310

 

Drupal 6 Clean URL configuration on Windows XP and Apache 2.2(依此实现Clean URL)

  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

Very helpful guide

shaunak – 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.

 在上述设置完成后,再进行以下两步:

(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

以上所述是小编给大家介绍的Drupal 6 Clean URL configuration on Windows XP and Apache 2.2(依此实现Clean URL),希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持!

原文链接:https://77isp.com/post/34525.html

=========================================

https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。