This is a 4.5.2 site that uses clean URL's eventhough the clean URL's in SETTINGS page is set to DISABLED.

http://ihea.info/dr/home

How could that be?

Now, ever since I started using 4.6, I can't get clean URL's no matter what I do. When I try to enable clean url's in SETTINGS page, it won't let me saying modrewrite is not enabled on my server (I am waiting for my host to respond about modrewirte.

Now, both of these sites are hosted on the same server at site5.com!

I have tried many things after reading forum posts here, including editing .htaccess and also using the instructions in the drupal handbook. Path module is enabled in both sites.

I am totally confused. Could someone please give me some guidance on sorting this out?

Comments

Aleet’s picture

Below is my .htaccess from the 4.6 site that won't use clean URL's.

Drupal is installed in root directory.

Changing

#RewriteBase /drupal

to

RewriteBase /

does not do the trick for me, eventhough it has been offered as a solution by forum topics. I get this error whenever I try to use cleanURL + path alias:

Not Found
The requested URL /index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.

Order deny,allow
Deny from all

# Set some options.
Options -Indexes
Options +FollowSymLinks
# Customized error messages.
ErrorDocument 404 /index.php
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More exist in sites/default/settings.php, but
# the following cannot be changed at runtime. The first IfModule is
# for Apache 1.3, the second for Apache 2.




# Reduce the time dynamically generated pages are cache-able.

ExpiresByType text/html A1

# Various rewrite rules.

RewriteEngine on
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
#RewriteBase /drupal
# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]
# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

# $Id: .htaccess,v 1.66 2005/03/20 19:15:00 dries Exp $

laura s’s picture

I've dealt with Site5 and very much like their servers. You do have mod_rewrite by default on Site5. Barring a problem on their end, one possibliity is that the issue could be with your cache. (Clear your browser's cache, too.) I ran into this issue with a client's site I moved to Site5 and upgraded, and I just kept clearing the cache table and suddenly it started working.

You might check your table and enable or disable clean urls directly. A search here will tell you which one -- it escapes me at the moment.

I wish I could be more specific, but this is what I focused on and ended up fixing the problem.

.:| Laura • pingV |:.

_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet

Aleet’s picture

Hi Laura,

Other than my browser's cache, what other kind of cache is there? Is there a cache inside Drupal? I don't have cache enabled? Does it still cache somewhere?

And are you saying clear the cache WITHOUT changing the .htaccess like I show above?

By the way, the last two times I've sent questions to site5 reseller support it was hours before they responded, unlike the past. I hope they are not going down the hill. Wondering if you've had trouble like that too.

laura s’s picture

The last time they were very quick. Before that, though not so fast, but I think they were having problems with their new superhosting control panel or something.

Your .htaccess file does not look like what I remember Drupal's being, but I don't see any glaring problems. You don't need the path argument if you're in the root. 4.6 has a file with more detail on the mod_rewrite conditionals. You might try that.

Cache is a table in your database. If you use phpMyAdmin (which is in your control panel somewhere) you can browse your database and find it. Select it, then click "empty" on the top right of the screen. (Don't drop it, just empty it.)

The problem I seemed to narrow it down to was that my browser seemed to think I was running clean urls, while Drupal was not -- or the other way around, I don't recall now. So I could not even log in! I could manually call up a page, but when I tried to login, Drupal would not find the proper resolution page, and so I was locked out. Trouble.

So I went into the database and changed the clean urls setting in the appropriate table (a search here will reveal which one) and cleared the database cache and my browser cache, and suddenly was able to log in.

I couldn't set clean urls right away, though. I disabled cache on the settings page, emptied the cache table, then set clean urls, then enabled the cache again.

(This is all my fuzzy recollection -- it was a long and frustrating night, that one upgrade.)

Sudden recollection: I will leave the rest of this reply up, just in case, but now I recall that my TextWrangler was mangling my htaccess file, so it was unreadable. Be sure you transferred it ASCII, that it's encoded UTF-8 (no BOM). Confirm that in your ftp client -- view file as text and see if it comes up legible. This actually could be it.

.:| Laura • pingV |:.

_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet

Aleet’s picture

Hi laura,

Thanks for all info. I installed a fresh copy of drupal 4.6 on another account, downloaded and uploaded to my ailing account using ascii. Problem not solved.

I get this error in red letters when enable clean url's in settings page:

"It appears your host is not configured correctly for Clean URLs. Please check for ModRewrite support with your administrator."

I was surprised that you said the .htaccess doesn't look familiar to you. I compared it to the fresh one I installed and it looks identical.

I'll try cleaning the cache and I'll report back. thanks.

sepeck’s picture

If the auto detect stuff for clean url's is saying it's not configured correctly, then you are really looking at an apache problem. See if the root Apache stuff has Allow Overide all, if your host does not allow it, then your local directory htaccess file is fairly useless.

-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

Aleet’s picture

My Modrewrite error was generated because the sites in question all are on temporary domain names not on real domain names.

I just use my ip address, followed by the username of the hosting account of a client to point to point to the drupal installation I am working on until client decides on what domain name he wants, like here:

http://209.59.144.99/~sane2/?q=page1

Clean URL's does not work in such a situation, which is pity because all the nav links have to be created in the ?q= style.

media girl’s picture

I did two sites on Site5 where I built them before moving the domain pointers (so I had to use the IP address/subdirectory address in settings), and yet I had clean urls on both, no problem.

--
mediagirl.org

Aleet’s picture

Yes, it is strange.

I am curious how you pointed to those sites. Did you use the method I describe above? ip address /~username?

Maybe you did another method that would avoid the problems I am having wit h clean URL.

media girl’s picture

IP address/~siteusername

I set that in the config file as the url path. I don't think I changed the path on htaccess. The settings file did it all for me, and when the domain pointers propogated, I simply changed the path to the domain in the settings file, and all was good.

--
mediagirl.org

drdave’s picture

Actually, clean URLs do work with this sort of temporary domain name (IP/~some_username). After sweating it a bit, here is how I solved it for me:

You need to edit the .htaccess file and modify *both* the RewriteBase and each RewriteRule to take in account the extra folder in the URL path.

For example, if your site is at http://xx.xx.xx.xx/~yourname/, then you need to uncomment and edit the RewriteBase thus:
RewriteBase /~yourname

The edit each active RewriteRule thus:
RewriteRule ^(.*)$ /~yourname/index.php?q=$1 [L,QSA]

This did the trick for me...

Aleet’s picture

Thanks drdave for sharing your solution. I'll try it and report back.

mmtahir’s picture

I was able to resolve the issue of clean URLs at my local host by following the following steps: (But...)
----------------------------------
>> Apache configuration:
----------------------------------------------
>> edit httpd.conf file:

>> find and uncomment it:
AddModule mod_rewrite.c

>> find and uncomment it:
LoadModule rewrite_module modules/mod_rewrite.so

>>.htaccess configuration:
----------------------------------------------
>> Open .htaccess file (in the drupal root)
>> find and uncomment the following lines

RewriteEngine on

# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /drupal #(where drupal is the name of subdirectory where drupal is installed)

# Rewrite old-style URLs of the form 'node.php?id=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^id=([^&]+)$
RewriteRule node.php index.php?q=node/view/%1 [L]

# Rewrite old-style URLs of the form 'module.php?mod=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
RewriteRule module.php index.php?q=%1 [L]

# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

>> Drupal Engine Settings
------------------------------------------------
>>Open drupal site: >> Administer >> Settings
Change option to set Clean Urls: Enabled

>> Save changes and refresh your home page

>> Hope you will be lucky
-----------------------------------------------------

(But ...) I am not sure if the remote server if not configured "mode_rewrite", there is any work around. I would like to share the experience with crispy or any other, if you were able to resolve it even if the server(ISP) is not configured accordingly.

thanks

Saeed