Hi everyone,
I've been trying to get the clean URLs to work in Drupal 5.0, with no luck for a second day, on a local WindowsXPsp2/Apache2/PHP5 installation. I have followed all the instrcutions on http://drupal.org/node/15365, and tried everything suggested in multiple forum topics. However, the radio buttons on the Clean URls Site configuration page are still shaded (disabled). Here are the relevant lines in the Apache configuration files (comment lines in between deleted).
httpd.conf
================
LoadModule rewrite_module modules/mod_rewrite.so
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
.htaccess (in "C:\Program Files\Apache Group\Apache2\htdocs\drupal5")
=================
RewriteEngine on
RewriteBase /drupal5 (I did try "RewriteBase /" as well)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
I have also deleted the "<IfModule mod_rewrite.c>" and "</IfModule>" lines enclosing the lines above.
As you can see, I have followed everything by the book with no success. This is becoming frustrating... Can anyone help please?
Thanks in advance!
Comments
You need to
do the "clean url test" to get the buttons enabled, it is a link embedded in the blurb near the end.
www.scryptik.com - Javascript editor with syntax error checking
www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy
"clean url test" link
Unfortunately, it doesn't do anything other than producing a server error page. It is a link with a "clean URL" and, since they don't work, clicking it gives the error page.
httpd.conf
This is my entry for drupal5, windows xp apache1.3
Alias /drupal5 "D:/drupal-5.0"
<Directory "D:/drupal-5.0">
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
In .htaccess you do need the
RewriteBase /drupal5
which you seem to have.
I have rewrite enabled like this:
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
#LoadModule speling_module modules/mod_speling.so
LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule anon_auth_module modules/mod_auth_anon.so
Otherwise, I have no more ideas.
www.scryptik.com - Javascript editor with syntax error checking
www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy
AddModule deprecated
AddModule is deprecated in Apache 2, and trying to use it produces server error. LoadModule is used instead.
I shouldn't need the Alias directive, since my Drupal directory is a sub-directory of the DocumentRoot. I can try it, anyway, just out of curiosity.
Other than these two, I don't see differences with what I have. By the way, the Drupal's help page on Clean URLs (see link in my first post) states that MultiViews option may interfere with clean URLs, and I noticed that you have it in your "httpd.conf". Have you observed any problems at all?
Ummm
I assumed the Alias tied up with the Rewritebase, but I remember spending hours trying to get it going and just settling on what worked when I got it. The Rewrite base is only necessary on localhost, I have never needed it on remote hosting unless the drupal site is a sub-domain.
BTW, I am using php4.
Multiviews works for me.
You could try Apapche 1.3, not sure what you gain by using 2 on localhost, I don't think shared hosting providers use it.
Sorry I havn't got the magic aswer.
www.scryptik.com - Javascript editor with syntax error checking
www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy
Solution for Clean URLs
Hello everyone!
Firts post, first solution.... ;-)
I had the same problem, and i found a way to work with clean URLs.
My system is running:
Windows 2000 Pro
Apache 2.2.4
PHP 5.2.3
Drupal 5.1
Drupal is placed under the Document Root in a subfolder named D5_1
(C:\Programs\Apache Software Foundation\Apache2.2\htdocs\D5_1)
The relevant lines in the Apache configuration files in my httpd.conf are:
httpd.conf
================
LoadModule rewrite_module modules/mod_rewrite.so
DocumentRoot "C:/Programs/Apache Software Foundation/Apache2.2/htdocs"
Options FollowSymLinks
AllowOverride All
Deny from all
Satisfy all
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
My .htacces file is the following:
.htaccess (in "C:/Programs/Apache Software Foundation/Apache2.2/htdocs/D5_1")
=================
RewriteEngine on
RewriteBase /drupal5
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
If you need more assistance, feel free to ask me!
PS: sorry for my bad english!
See ya
Andrea aka "Ataru Moroboshi"
Still not working for me
I tried what Moroboshi suggests with no avail.
Microsoft Windows XP Pro, 2002 SP 2.
Apache 2.0.59
Drupal 5.5
PHP 5
Using localhost for development.
Are there series of tests I can do to test each step?
Otherwise, I am changing a bunch of things and just "hoping" for a good result, this is no way to do installations!
For example, I would like to test:
1. Is Apache configured CORRECTLY for "Clean Urls".
2. Is Drupal configured CORRECTLY for "Clean Urls".
At this point I don't know which part, if any, is working.
Thanks,
-serge
Worked for me too
Hi Powaserge,
Look at httpd.conf, change the following block:
<Directory />
Options FollowSymLinks
<b>AllowOverride All</b>
Order deny,allow
Deny from all
Satisfy all
</Directory>
Along with:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
Options Indexes FollowSymLinks
<b>AllowOverride All</b>
Order allow,deny
Allow from all
</Directory>
Thanks for that, just helped
Thanks for that, just helped me out with the latest EasyPHP package.
---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials
---
Yuriy Babenko
http://yuriybabenko.com
My Drupal tutorials: http://yuriybabenko.com/blog/tag/tutorials
auto-generated .htaccess file breaks site w/ mod_rewrite
// windows xp sp2, apache 2.2.4, php 5.2.2 //
If I change "None" to "All" (see below),.....
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
Options FollowSymLinks
AllowOverride All
</Directory>
... then ALL pages break (including pages using the ugly urls, AND pages using the "clean" urls) .... because of an auto-generated .htaccess file that drupal insists be there. (if i delete it, drupal re-creates it). By "breaking", however, I mean the pages all act as if they are files of unknown type, and a download dialog pops up. When I download it, I see the code for drupal's main page, index.php. So what's happening is apache no longer passes the page to php to parse. Instead, its just served up as-is.... php code and all.
The workaround (in my case) was to edit the .htaccess file and remove all lines, leaving a blank file. I can't just delete it because drupal will re-create it. I know the file has to do with a security vulnerability... ( http://drupal.org/node/66763 )
The problematic htaccess file is generated at document root (which is one directory above the drupal install) and has these lines:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006Options None
Options +FollowSymLinks
So, the file is at /.htaccess
My drupal install is at /drupal_4_7_6/
I believe drupal creates the file at root because my "File system path" setting (in admin/settings) is set to ".." (without the quotes) because I wanted my files to be shared among several different versions of drupal, all in their own directories (like /drupal_4_7_6/, /drupal_cvs/, /drupal_4_7_4/, etc....)
I don't really know for sure, but I don't think my workaround (removing the commands from that htaccess file) is opening a security hole, because an identical .htaccess file is located in my /files directory (where the files are located).
Just posting this here in case it helps someone.
Something that worked for me
In windows/apache I have the apache 2.2.8 root in
c:\wamp\www
there I put my sites, so I have, for example c:\wamp\www\sabordaria\drupal (http://localhost/sabordaria/drupal)
I tried everything sugested here with no luck until I changed in the .htaccess the line
RewriteBase /sabordaria/drupal
(before was commented or just
RewriteBase /drupal )
clean url works now
Hope that helps
Finally it works
thanx alot r.marino for posting the details. i've been rippin my hair out for dayz tryin to get this thing to work... i had named my drupal directory 'drupal-5.8' (plz dunt ask why), so i had to change RewriteBase /drupal to RewriteBase /drupal-5.8 and also make sure that you leave RewriteBase / commented....
Clean URL's - Wampserver
My method....
Locally, Under WAMP toolbar icon, choose APACHE / APACHE MODULES and tick rewrite_modules
Return to Site Configuration / Clean URL's and enable the Clean URL item
Took me ages to find but the result in the end was easy - May help other Wampserver Clean URL people???
Thanks Kaybee, I am using
Thanks Kaybee,
I am using Wamp to test / build a site on my home comp. This method definitely works for Wamp, and yeah so easy.
I am new here, this is my first ever comment.
Maybe this thread should have a question near the top to ask what testing server people are using, because I tried several of the other methods, before reaching this one for Wamp ... right at the bottom of the thread.
Just thought it may save people time in the future.
Yup... total noob here.