I recently installed drupal 7 rc2.
Everything works fine except my Clean URL's. I followed the guide as described on drupal.org but when I do the Clean URL test nothing happens and there are no options to turn them on or off.. Can anybody please help me?

Comments

You need to copy the .htaccess file over to your server too. Just happened to me too.

I did it! thanks for the reply. The error come out of the .htaccess file.

I'm having the same problem and the .htaccess file was copied fine...still the same problem...

I have made an upgrade from 6.20 to 7.0 (Apache on GoDaddy, may they have their servers in their homes :) ). No button for turning on Clean URLs appears on "...admin/config/search/clean-urls". The only buttom present is "Run The Clean URL Test" which returns you back to the same page. I tried to re-upload to the remote server a fresh copy of .htaccess, uncommented there "Rewrite Base", which used to help with Drupal 6. Nothing worked.

Dear kind fellows, please be even kinder and bring me back my "Clean URLs" button!!! :(

I'm having the exact same problem with trying to enable Clean URLs.

After navigating (.../Configuration/Search and metadata) and hitting the button "Run the clean URL test". My screen just flashes and the exact same screen appears. I see no results of the test and I have no boxes to check (or uncheck).

OK - here's how I fixed my problem.

I read http://drupal.org/node/15365 very carefully and realized I need to change my .htaccess file

It turns out my .htaccess file was empty (not sure why), so I downloaded from

http://drupalcode.org/viewvc/drupal/drupal/.htaccess?view=log&pathrev=HEAD

and now I have a check box for enabling Clean URLs and I check the box and how it all works.

Hope this helps others.

Since the link posted by EdgeDude no longer works, I thought it could be of interest for other people looking for the solution to this problem have a new (working) link:

http://drupalcode.org/project/drupal.git/commit/fdc91796bfc2da4baae1dae1...

Marco

the working link solved everything for me (working on wamp).

Thanks Marco! I just DL'd this .htaccess file and put it on my server. Once I re-ran the test, I got the Clean URLs checkbox.

Yea Drupal community docs!!

Thank you so much, this was where I got stuck.

Peter

Hi
I was having the exact same problem with my site. then i checked this link given on the popup for clean urls in drupal 7. i read all the information and then got to know that i will have to enable Apache mod_rewrite on my local server. this was the solution i was looking for.
so enable the mod_rewrite of apache on your server to get rid of this problem

Sohail Anwar

This fixed it for me, running WAMP.

Ran into the same issue here. Nothing helped. Not even all of the modifications to HTACCESS file.
Finally i reset the htacces file to default. Uploaded and went to the clean urls activation page. Still the same result after clicking on the test button. Then I thought, why not manually remove the '?q=' part from the url and see what happens?

Voila! Manually entering "admin/config/search/clean-urls" instead of "?q=admin/config/search/clean-urls"
got me to the page but now with the checkbox! One check and save and all is ok now.
Still can't seem to understand why it dod not go to the right url itself though...

thanx!

Worked for me, too :)

You saved my day ! Thanks !!!!!

This worked for me too, thanks!

thanks too!

@Sebbon: thanks, that fixed it!

@Sebbon

You are a genius. I was thinking I'd have to do some gnarly hack in the variables table to make that work. Many thanks!

--
Charlie Harvey @ciderpunx

After several hours of wasted time, I found your solution. Worked great, problem seems to be solved.

Thank you!!

Your solution worked for me! Thanks Sebbon!

I could kiss you... but I'll just say thanks.

This was the only thing that worked.

thanks a lot!! it works!!

Thank you!

Worked for me!!!! great solution!! [=

@ sebbon, worked perfectly on Drupal 7 using easyspace as a host - this may help someone in the future! thanks

This is what worked for me too.
No idea why.

But I had to make the /index change before this worked.
Also made the RewriteBase change even though it didn't seem necessary.

Also, note that htaccess changes are not hacks.
They are explained in the clean urls handbook here - http://drupal.org/node/15365

Thank you! This save me !!

After reading the comments I focused on the .htaccess file and realized that on my server the .htaccess file actually had a .txt on the end of it. I removed the suffix so it went from ".htaccess.txt" to ".htaccess" then went back to the clean url page and the check box was there!

I hope this helps out. This may be happening if you used "Simple Scripts" from your Cpanel to install Drupal.

-Vic

Hit the nail right on the head. Combined this suggestion with @Sebbon and there was a happy little checkbox. Thanks!

and it will work!

Another possible reason why you don't see the checkbox is if you have installed Drupal 7 in a subdirectory. I had to edit the .htaccess file and set RewriteBase before the checkbox would appear. For example, if Drupal is installed in "http://www.example.com/d7/", then in .htaccess you need to set:

RewriteBase /d7

(see the comments in the file).

Thanks for the comments. In my case, that was none of the above. As I moved to another hosting (from GoDaddy.com to JustHost.com), the problem has been solved by itself. Therefore, the server options were not correct and I had no access to change them.

That is what was preventing me to get it to work

Thanks! This one did it for me as well! :)

Many thanks, save my much time, from 2:00pm to Now(22:30pm) today to figure out this problem. finaly, done here.

my D7 is subdirectory,
find the .htaccess file in D7 root, and open it,
find the "# RewriteBase /drupal" in codes, delete the "#", change the "drupal" to your file's name: my file is "blog",
"RewriteBase /blog" - the end change to this.

I was still having problems getting clean URLs working after trying advice suggested above. In my case, I had to edit the Apache (2.2.17) httpd.conf file and in the "Directory" directive for my DocumentRoot, I had to change "AllowOverride None" to "AllowOverride All". After restarting Apache I was then able to enable clean URLS.

Andrew

Had this same issue, same resolution. How this ends up in production, I don't know...

Hello all,

I'm preparing my fresh install of drupal 7 and
this problem occur.
But editing my "/etc/apache2/sites-available/default"
from AllowOverride None to AllowOverride All
under the Directory directive solved the problem.

Thanks to apriebe.

If you're having this problem, make sure your Apache VirtualHost definition includes an "AllowOverride All" directive in the Directory definition. Something like this:

<VirtualHost *:80>
    ServerName mydrupalsite.com
    DocumentRoot /path/to/drupal/docroot
    <Directory /path/to/drupal/docroot>
        AllowOverride All
    </Directory>
</VirtualHost>

This will allow Apache to respect your .htaccess file's directives.

I am a noob.
Where do I place that code, or where do I find it in a file, and where do I find the file?
thank you.
Also, are this fixes on local machines?
I am hosting with 1and1, and would like to know how to fix it there.

Change
RewriteRule ^ index.php [L]
to
RewriteRule ^ /index.php [L]

This worked for me to, on a site hosted by 1and1. For this site, I needed to add this to my .htaccess, so that the server would use PHP5 instead of the v4, which is the default:

AddType x-mapp-php5 .php

I was worried that was messing up my .htaccess file, but your suggestion did the trick. Thanks!

after trying all the other solutions... the slash before the index worked for me. Thanks! I'm with Bluehost...

Solved!
Thanks a lot!

I host multiple sites using GoDaddy. All of my sites are under SubFolders, so here is how I easily corrected the "Clean URLs" issue.

1) In my SubFolders, I editted the ".htaccess" file and uncommented the "# RewriteBase /". So it now simply looks like "RewriteBase /" (without the quotes of course...)

*** If you do not have the ".htaccess" file in your SubFolders, simply copy and edit the default one the comes with the Drupal installation.

2) I then used a "clean url" to get to the configuration page: "http://MyWebSite.com/admin/config/search/clean-urls" instead of "http://MyWebSite.com/?q=admin/config/search/clean-urls".

3) Enable the CheckBox and Save.

Keep in mind that if you do an update (like 7.0 to 7.2), you want to make sure that you don't overwrite the ".htaccess" file.

Best of Luck!

I had clean URL's turned on, but they went away with my update to 7.2. I did not overwrite my .htaccess file in the process. I was not able to re-enable by going through the admin menu, but when I went directly to admin/config/search/clean-urls as suggested above, it worked.

I don't know if it will hold, but it's great for now. Thanks!

ok the way I fixed it for me with drupal 7.4 was by re downloading drupal, got the full drupal install so I could get the .htaccess file then replaced my faulty file with the proper one..

This time when I redid the check test there was a button to enable clean urls :-)

Oh happy day. thanks for all your help guys

slater out.

My Drupal Site Http://www.bbxbattles.com

I had the exact same issue and you're solution helped me out (on godaddy hosting)!

Thank you so much!

This is exactly what I had to do after installing Drupal 7

The solution discribed here worked for me with an multisite install.

admin/config/search/clean-urls

Practice what you preach >> www.jawi-online.nl >> Full service internet bureau >>

my solution was even easier, I just extracted a copy of Drupal on my desktop, and uploaded the .htaccess file in it to my server. Worked just fine for me after that.

I tried pretty much everything in the posts above, and though I am sure they worked for some people, nothing worked for me - until I tried this

In .htaccess, replacing

RewriteRule ^ index.php [L]

with this

RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

I was running Drupal 7 in a sub directory, which is where the .htaccess file I modified was. (I had experimented with the .htaccess file at doc root also, to no avail.)

Yes! That's it, just created an account to thank you. Man, I love you!

there are two sites on our server
public_html/site1/drupal
public_html/site2/drupal

site1 is an old site that we are working to migrate over. site2 is the drupal site I am working with. updated drupal core located in
public_html/site2/drupal

encountered this problem....when I navigate to
admin/config/search/clear-urls

I get directed to the home page of the old site.

+1 for the bug. I eventually found out how to turn it on (Ubuntu + Apache2 help), but some notification of failure would be appreciated. As a UX developer trying to learn Drupal, I can easily see how confusing this makes things for the average newbie.

Not familiar enough with the Drupal API to submit a patch, but you have my moral support.

Edit: Discouraging that my first post on drupal.org is bug-related...

The Godaddy solution by Mirfster (above) works.

None of these things worked for me, but I eventually found this solution:

In your .htaccess file, replace : RewriteRule ^ /index.php [L]
with: RewriteRule ^ /?q= [L]

Cheers!

/Benjamin

Hi

In apache error log file, I was getting this error

"order not allowed here"

I added this in my apache configuration file

AllowOverride FileInfo Limit Options Indexes

and restart apache.

Note: I got this solution from here http://devtime.blogspot.com/2008/02/htaccess-order-not-allowed-here.html

Drupal version is 7.9

Thanks

akki

the solution changing RewriteRule ^ index.php [L] to RewriteRule ^ /index.php [L] worked for me thanks guys

4173796d6574726963206f6666656e6365202d20616476657273617269616c206d696e642d7365742c20706572736576657 2616e636520616e6420696d6167696e6174696f6e

So is there any way to enable 'clean_urls' in database `variable` table?

If your server is running on Apache make sure you have the '.htaccess' file present on your server. If it's not there simply create an '.htaccess' file and load it in the same directory where you have Drupal installed. Name it .htaccess (with a dot in front as oppose to htaccess or .htaccess.txt

The '.htaccess' file should contain:

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

If this is all in place then just go to Amin > Configuration > Clean URL and test and Enable this feature.

I'm having this issue as well. I've tried change htaccess file as stated multiple times and with different code, all with no luck.

I have no idea what to do. I have no check box and when I run the test, it says failed any help would be great. Thanks in advance.

You have got to try this answer from "above." It's a miracle! https://drupal.org/node/1002832#comment-4182496

Local:
Mac OS 10.7.5
Firefox 22.0

This is the .htaccess content worked for me.

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.

Order allow,deny

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.

# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 "The requested file favicon.ico was not found.

# Set the default handler.
DirectoryIndex index.php index.html index.htm

# Override PHP settings that cannot be changed at runtime. See
# sites/default/default.settings.php and drupal_initialize_variables() in
# includes/bootstrap.inc for settings that can be changed at runtime.

# PHP 5, Apache 1 and 2.

php_flag magic_quotes_gpc off
php_flag magic_quotes_sybase off
php_flag register_globals off
php_flag session.auto_start off
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_flag mbstring.encoding_translation off

# Requires mod_expires to be enabled.

# Enable expirations.
ExpiresActive On

# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600

# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off

# Various rewrite rules.

RewriteEngine on

# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or
# Git to store control files. Files whose names begin with a period, as well
# as the control files used by CVS, are protected by the FilesMatch directive
# above.
#
# NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
# not possible to block access to entire directories from .htaccess, because
# is not allowed here.
#
# If you do not have mod_rewrite installed, you should remove these
# directories from your webroot or otherwise protect them from being
# downloaded.
RewriteRule "(^|/)\." - [F]

# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# uncomment the following:
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]

# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

# 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]

# Rules to correctly serve gzip compressed CSS and JS files.
# Requires both mod_rewrite and mod_headers to be enabled.

# Serve gzip compressed CSS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]

# Serve gzip compressed JS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]

# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

# Serve correct encoding type.
Header append Content-Encoding gzip
# Force proxies to cache gzipped & non-gzipped css/js files separately.
Header append Vary Accept-Encoding

# $Id$