Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Just installed Drupal, default setup on apache/mysql (including mod_rewrite), tried the clean URLs configuration from the admin area and got stuck.
The clean URLs page loads, ending at the button "Run the clean URLs test", which I press, and the page reloads as it is.
From checking my logs, it starts at this page:
/?q=admin/config/search/clean-urls&render=overlay&render=overlay
Then tries to run this:
/admin/config/search/clean-urls/check
Which is a 404, as clean URLs aren't enabled yet! It then returns the first page without error.
I hope this is ok as a bug report, it's my first one...
Comment | File | Size | Author |
---|---|---|---|
#42 | htaccess.txt | 5.28 KB | chitwarnie |
#26 | clean_url_test_fails.gif | 68.21 KB | drupalastic |
Comments
Comment #1
heatherwoz CreditAttribution: heatherwoz commentedSimilar problem. There is no button to enable/disable clean urls, so I can't change the setting.
Comment #2
rafamd CreditAttribution: rafamd commentedSame to me from a clean install.
Comment #3
heatherwoz CreditAttribution: heatherwoz commentedSo it seems that the button to enable/disable does not appear at all if the server doesn't support clean URLs. It became available once we corrected the configuration. But it needs to be there always, in case the server configuration is changed and clean URLs need to be turned off. If clean URLs cannot be disabled this can impact the functionality of the whole site.
Comment #4
rafamd CreditAttribution: rafamd commented@heatherzwoz, do you see the button ? Because my server does support clean urls. I had them enabled with alphas 5, 6 and 7. I suppose the button doesn't show at all. Thought of changing this to critical but I'm leaving this for someone with more "authority" :)
Comment #5
OsterD CreditAttribution: OsterD commentedSame here!!!
I have a fresh install of 7.0-beta1.
Runs as a Virtual Host exactly the same configuration on vhosts file and htaccess of another Drupal 7.0-dev from DrupalGardens.
Behaviour is exactly the same as previous people.
Comment #6
OsterD CreditAttribution: OsterD commentedEven with version 7.0-beta2 same problem exists.
Comment #7
AnalogFile CreditAttribution: AnalogFile commentedTested with beta and with HEAD and they behave the same, therefore moving this to 7.x-dev
The title is probably wrong because once you do get it to the point where the test succeeds, the checkbox is shown even if you then change the server config back, therefore #3 assumption may be wrong.
Description of my test and observed behaviorHowever there's something fishy here, and I'm leaving the title as is for the moment.
I'm not sure what the logic is supposed to be, but there's definitively something inconsistent going on here.
I think that the ideal logic should depend on whether the code can or cannot automatically and reliably test for clean URL support without ending up displaying a 404.
If it's NOT possible to check reliably then IMHO the logic should be:
If it's possible then IMHO loading this page can be (from the user's point of view) what is needed to perform the test and the logic should be:
Looking at the sources (and the comments there) it seems to me that the code is supposed to do the test iff the page is loaded from a non clean URL. But I always used the same URL (non clean) in my tests and yet the behavior did not revert when I reverted the server support. I'm a programmer but do not know PHP (and am totally unfamiliar with Drupal). Is it something with the "variables" and their caching that is going wrong? Too hard for me to dissect, but I guess someone more familiar with this code could figure it out.
Comment #8
geerlingguy CreditAttribution: geerlingguy commentedMajor wtf from me - I noticed this problem on a shared host to which I had to manually upload the core files.
If you forget to upload the .htaccess file along with all the other configuration files, then the 'Enable clean URLs' checkbox will not appear on the Clean URLs configuration page. The 'Test for Clean URLs' button (whatever it says) appeared, and seemed to do something... but didn't show any results.
Once I uploaded that file, the checkbox appeared.
Comment #9
geerlingguy CreditAttribution: geerlingguy commentedJust noticed an older issue for the same problem: #881376: "Run the clean URL test" UX is broken. Please move discussion there.
Comment #10
cygii CreditAttribution: cygii commentedDid you try uncomment RewriteBase / in .htaccess ? If your drupal site is inside subdirectory add RewriteBase /your-subdirectory-name
Works for me
Comment #11
theGuardian-1 CreditAttribution: theGuardian-1 commentedIf you are unsing apache:
in "httpd.conf" file try to locate this line for apache to have the ability to do whatever it wants from the root of your site to whatever under.
my root here is "c:/wamp/www/"
Directory "c:/wamp/www/"
...
AllowOverride all
...
/Directory
then you should aslo look for :
#LoadModule rewrite_module modules/mod_rewrite.so
and take off the '#' so apache has loaded the module for rewriting URLs
then, just restart your apache services. And finally reload your page.
normally you should see the check box.
hope i helped. And sorry for any english mistake, my mother tongue is french.
Comment #12
hcabbos CreditAttribution: hcabbos commentedI banged my head on this for hours. Turns out my hosting company and perhaps many other people on shared hosts need their .htaccess file changed as follows:
This line needs uncommented:
RewriteBase /
***But more importantly,*** for Site5 hosting (and maybe yours too), you need to enter the hosting account user name as follows:
RewriteBase /~[username]/
Comment #13
bw1drup CreditAttribution: bw1drup commentedI found this rewrite code on my hostmonster forum from Falcon1986 that fixed the problem for me.
According to the Drupal documentation, you should have the following mod_rewrite in your .htaccess file.
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Comment #14
vega CreditAttribution: vega commentedI was able to enable clean urls after uncommenting
RewriteBase /
in the .htaccess file. And then going to the clean urls URL, without the ?q=
When I did that, the option to enable was presented to me.
Comment #15
mudtraining CreditAttribution: mudtraining commentedI couldn't get past the Clean URL test either... Took a while to track this down. #14 is the fix for me. http:///admin/config/search/clean-urls
Comment #16
flexiblemirror CreditAttribution: flexiblemirror commentedThanks, #13 works for me
Comment #17
MarkRennes CreditAttribution: MarkRennes commentedWhen I run the clean URLs test, nothing happens. The "Run the clean URL" button remains visible. What is presumably the command actually run is briefly displayed:
http://127.0.0.1/modules/Drupal/?q=admin/config/search/clean-urls&render...
Clean URLs can be seen subsequently NOT to have been set.
The contents of the .htaccess file that I believe to be relevant are:
RewriteBase /Drupal
# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
#RewriteRule ^ index.php [L]
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
I am confident that this is at least one of the .htaccess files which are accessed. However, there are other .htaccess files in sub-directories of Drupal. The full list is:
.htaccess 53 bytes File 21/03/2003 07:16 -a--- home
.htaccess 792 bytes File 16/06/2011 21:27 ----- modules\Drupal\sites\all\libraries\ckeditor
.htaccess 118 bytes File 23/07/2011 08:42 -a--- phpmyadmin\setup\lib
.htaccess 118 bytes File 23/07/2011 08:42 -a--- phpmyadmin\libraries
.htaccess 118 bytes File 23/07/2011 08:42 -a--- phpmyadmin\setup\frames
.htaccess 93 bytes File dimanche 08:05 ra--- modules\Drupal\sites\default\files
.htaccess 107 bytes File dimanche 08:05 ra--- tmp
.htaccess 107 bytes File dimanche 08:09 ra--- modules\Drupal\sites\default\files\private
.htaccess 5,37 KB File Today 17:41 -a--- modules\Drupal
.htaccess.bak 5,38 KB Fichier BAK Today 17:25 -a--- modules\Drupal
Can anyone suggest what it is that I am doing wrong? Many thanks.
Comment #18
MarkRennes CreditAttribution: MarkRennes commentedProblem solved, at least for me! To do it, I have reinstalled Drupal, PHP, MySQL and Apache... via xampp.
I had been using EasyPHP. I have now uninstalled that, installed xampp, and started with a fresh database. I had kept details of all the content and admin changes I'd made in my various earlier attempts to start building my websites. Clean URLs worked immediately on creating a new site in localhost.
Comment #19
spyderpie CreditAttribution: spyderpie commentedUncommenting # Rewritebase / worked for me.
Comment #20
Vandalf CreditAttribution: Vandalf commentedI had the same problem, and nothing I ever did worked. Whenever I tried to run the test, with whatever setting in .htaccess (my page is on a remote webhost, but I know that httpd has got the correct settings, as another site I've got is running perfectly with clean url's), I only returned to the test page, and nothing really happened.
Then, in a brighter moment, I tried to remove the ?q= from the url to the test, and all of a sudden I got a check-box giving the option to use clean url's!
Don't ask me why the test couldn't redirect me to the check-box page, but anyway, it now WORKS! :)
Comment #21
jagmeister CreditAttribution: jagmeister commentedI am a noob to this. I am using hostmonster but nothing works and i dont know if i am editing correctly. my .htaccess file just has the apache handler then there is a .htaccess.txt file in which i see something like
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
should i replace it with
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
or should i add it somewhere else
NEVER MIND
I got it to work by renaming the .htacess.txt file to .htaccess
Comment #22
kaba85 CreditAttribution: kaba85 commentedRemoving # before the /RewriteBase solved the problem for me :)
Comment #23
fuse CreditAttribution: fuse commentedI had the same problem, tried Vandalf's method in #20 en was able to enable clean URL's.
Maybe someone need to look into this problem, because this ahppend to me with a fresh install on a server I was previously able to switch on clean URL's without any problems on other Drupal installations. Maybe this bug got introduced since 7.9?
Comment #24
Edward.H CreditAttribution: Edward.H commented#20 worked for me ,I don't know why ,but I worked :)
Comment #25
drupalese4711 CreditAttribution: drupalese4711 commented#20 worked for me, too.
Thanx a lot Vandalf, i wish you a merry christmas!!! :-)
Comment #26
drupalastic CreditAttribution: drupalastic commentedFor local wamp/apache users simple steps :
click wamp icon on tray
apache > apache modules
select rewrite_module (mark selected)
refresh and the test will pass
make sure to restore .htaccess to its default (if you have made any changes)
Comment #27
diskojerk CreditAttribution: diskojerk commentedI was unable to pass a clean urls test on my site while in maintenance mode. I took it out of maintenance mode and the checkbox to enable clean urls was there.
V7.12
Comment #28
tpg CreditAttribution: tpg commentedI tried all of the above including 13 but in the end found a post which had the following
http://domain/admin/config/search/clean-urls
I did this and now my clean URL's are working.
Hope it helps.
Comment #29
sethviebrock CreditAttribution: sethviebrock commentedYou can't get the clean URL test to pass while browsing in the admin overlay on a previously-non-clean-URL site. To reproduce this issue, you have to be running non-clean URLs, with admin overlay enabled, and run the clean URL test - it will fail. Either disable admin overlay or go directly to admin/config/search/clean-urls and run the test again. It should work and provide you with a checkbox to enable clean URLs if your .htaccess file is correct and mod_rewrite is enabled.
Comment #30
phuongnam3k CreditAttribution: phuongnam3k commented#11 works for me! Thanks so much. you're awesome
Comment #31
jaxx0rr CreditAttribution: jaxx0rr commentedye this worked for me (#11 and #26) but in .htaccess this line needs to be COMMENTED
# RewriteBase /
Comment #32
josephsergio CreditAttribution: josephsergio commentedMy .htaccess file only has the following:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks
_ _ _ _ _
Does anyone have a solution as I still cannot enable clean URLS? Thanks in advance
Comment #33
Anonymous (not verified) CreditAttribution: Anonymous commentedDon't forget to get your site out of maintainance.
When it's in maintenance you can't enable clean url's
Comment #34
avonleadesign CreditAttribution: avonleadesign commentedI had to add hash to
RewriteBase /
so it became# RewriteBase /
and then follow #14! Thanks, Vega!
Comment #35
WriteCo CreditAttribution: WriteCo commentedUncomment RewriteBase and clear the cache. I worry me sometimes...
Oh right, I just updated to 7.16, fyi, and somehow I lost the working .htaccess file I had. ...All better now.
Comment #36
PEP3 CreditAttribution: PEP3 commentedI had the same problem the cure?
- Take the site out of maintenance mode......
Then it all suddenly worked. Is it perhaps worth adding that note to the clean urls test page as it could save lots of people hours of working out what is wrong?
Comment #37
mkapst CreditAttribution: mkapst commented#13 worked for me
Comment #38
goback136 CreditAttribution: goback136 commented#36 worked for me.
Comment #39
Anonymous (not verified) CreditAttribution: Anonymous commentedNOTHING works for me! I have tried every single one of the above options and more.
Comment #40
kalidasan CreditAttribution: kalidasan commented(#26) Its working fine for me. Thanks dude. Cheers !.
I have enabled RewriteBase / from .htaccess But no use. It was not worked (I can able to see the check box. But could not save it).
After Enabled rewire_module from apache modules only it was working.
Comment #41
fullerja CreditAttribution: fullerja commented#29 solved my issue. I am upgrading from a D6 site. It seems that there is some conflict between overlay and clean URLs. I disabled Overlay, enabled Clean URLs, and then re-enabled Overlay. All seems to work now, including Overlay. Order of operations is a little strange to me, but hey it works!
Comment #42
chitwarnie CreditAttribution: chitwarnie commentedEnvironment
Ubuntu 12.04 LTS
XAMPP (apache 2.2, PHP 5.3)
for some reasons Drupal did not install the .htaccess even with my mod_rewrite enabled so i just copied from a previous installation and it started fine (my previous installation was Drupal 7.2) current version 7.22 has the issue we are discussion right now.
just copy the code from the attached file and paste it on a new file called .htaccess and save the changes and all should be ok
Comment #44
krknth CreditAttribution: krknth commentedThis link also will helps to disable clean URLs its worked for me
Disabling clean URLs
Comment #45
tmehta CreditAttribution: tmehta commented@theGuardian - Very simple but effective to-the-point solution. Can't thank you enough!
Comment #46
sky10 CreditAttribution: sky10 commentedHi all,
I had this problem with wamp. The path of drupal was www/drupal. I solved this in 2 simple steps:
1. Uncomment this line in httpd.conf: LoadModule rewrite_module modules/mod_rewrite.so
2. Modified this line in .htaaccess: RewriteRule ^ drupal/index.php [L]
Comment #47
caco13 CreditAttribution: caco13 commented#14 worked for me, without to uncomment line
RewriteBase /
in .htaccess
The problem was just that the menu path to Clean Url enable/disable page writes the URL with ?q=, and then the box Enable clean URLs is not displayed. If I correct the URL (whitout ?q=), the bottom is displayed and I can select it. Now works fine.
Thanks vega!
Comment #48
mahipal46 CreditAttribution: mahipal46 commented#20 works for me... great ;)
Comment #49
miniwebs2 CreditAttribution: miniwebs2 commentedSOLVED: Drupal 7.39 Clean URL's fail on custom template installed. Tried all sorts of modifications until one of the comments above solved the problem.
Remove the ?q= from the url to the test and run again - checkbox now comes up and clean url's can be enabled.
Weird but worked for me!
Comment #50
randomyao22 CreditAttribution: randomyao22 commentedIf all above fixing are not working for you, you may need to have a look at two things:
1. Is your .htaccess working?
2. Is your mod_rewrite working?
See how to test and fix them: https://docs.bolt.cm/howto/making-sure-htaccess-works
Comment #51
SseggembeMoses CreditAttribution: SseggembeMoses commented#8 worked for me