Cleanurl test runs without error on my new site but no Cleanurl .I am hosting on 1and1

Comments

iAutom8’s picture

Hosting on HostGator.

Thanks

--------
Additional comments:

When I go the Clean URLs form there is no "Enable or disable the Enable clean URLs checkbox". All I get is:

Home » Administration » Configuration » Search and metadata » Clean URLs.
Use URLs like example.com/user instead of example.com/?q=user. If you are directed to a Page not found (404) error after testing for clean URLs, see the online handbook.
[ Run The clean URL test ]

I found that the clean URLs do in fact work if I type the URL manually. However, all my site links contain ?q=

iAutom8’s picture

Need to investigate further next time ;)

Found the following issue on the subject --> http://drupal.org/node/881376

iAutom8’s picture

  • disable Overlay module
  • go to Clean URLS
  • change URL from: /?q=admin/config/search/clean-urls
  • to: /admin/config/search/clean-urls
  • Then the Check box should appear (at least in my case)

Hope this helps.

electronicmonkey’s picture

All I get is error 500

DjCharlieHood’s picture

i had stopped creating content b/c of this. your meth worked for me. using hostgator too.

electronicmonkey’s picture

I had another site running D6 on 1and1 and I just swapped the htaccess since it had cleanurl. I now have Cleanurl on my D7 site

sunfire-design’s picture

Thanks a lot for this great tip.

After hours of searching, now clean urls working at domainfactory webspace.

corE’s picture

I too had problems with Clean URLs installing Drupal 7 on 1and1 - I ran the test and it would not pass. As you mentioned above (Post by iAutom8) the problem was in the overlay - and, as mentioned below that (Post by electronicmonkey), when I did the "disable Overlay module" fix, I too received a error 500. My immediate next step was to uncommented "RewriteBase /" in .htaccess and than I went back to the above fix and it worked. The problem was in the overlay. This worked for me.

So to summarize (with additional step):
1) disable Overlay module
2) go to Clean URLS
3) change URL from: /?q=admin/config/search/clean-urls to: /admin/config/search/clean-urls
4) uncommented "RewriteBase /" in .htaccess
5) Then the Check box should appear (at least in my case)
(from a previous earlier step I also have $base_url in settings.php uncommented and set to my domain name)

I spent A LOT of time on this, and did a lot of tinkering, so I hope I didn't miss mentioning anything.

GovLk’s picture

Thanks Lot after hours of searching this works for me.

tziebart’s picture

1. disable Overlay module.
2. uncomment rewriteBase / - My installation was at the document root /var/www.
3. In the apache2.conf file in /etc/apache, comment out: # AllowOverride All.
4. In the file default, found in /etc/apache/sites-available,


Options Indexes FollowSymLinks MultiViews
AllowOverride All <-- ****** change AllowOverride from None to All.
Order allow,deny
allow from all

5. Go to /admin/config/search/clean-urls and the check box appears.

Acertijo’s picture

thanks

joshintosh’s picture

I forgot to copy the .htaccess file over from the Drupal 7 install. Doing this fixed this same issue for me. It's too bad there isn't some kind of note on that page when the Clean URL fails like this. Maybe a check list to help the person troubleshoot the problem?

mops’s picture

check your .htaccess file

# 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

replace
# RewriteBase /drupal

with
RewriteBase /yourdrupalfoldersname

for example :

www.---.com/mydrupal/
RewriteBase /mydrupal

hope it helps

aaronmacy’s picture

This worked for me with Drupal 7 on 1&1.

Anonymous’s picture

2 days doing this now.

I uploaded my site to localhost/drupal dev - no problem - and changed the settings.php with the $conf[ 'clean_url'] = 0; - the site still runs - without the clean-urls - but, i made a mistake while trying to figure things out and tried to import the site again on my other laptop - and I have copied EXACTLY the same process and I can't disable the clean-urls - so the only page that displays is the hp - I can find the other pages - including the clean-urls page - with this:
http://test.localhost/?q=user/1#overlay=%3Fq%3Dadmin%252Fconfig%252Fsear... - but, i can't run the test, or disable from here - without getting the:
Not Found

The requested URL /node/7 was not found on this server.

I have tried changing the htaccess - no difference...I have used an sql query to delete in clean-url instances in the phpadmin (sorry if this isnt the right language) and have deleted cache...and IT STILL DOESN'T WORK! I am trying to work out the httpd.conf thing at the moment...but, I can't believe it can be that difficult when it was that easy the first time...

Any idea what I am doing wrong?

Thanks!

kaushalkishorejaiswal’s picture

1). Check the mod_rewrite is enabled or not for your apache server:
Command:
apache2ctl -M "OR" apachectl -M
Note 1: The above command list all the loaded modules of your apache configuration.
Note 2: You can also check it by using the phpinfo() function print. apache2handler ==> Loaded Modules

2). If the mod_rewrite module is not enabled then enabled it:
Command:
cd /etc/apache2/modes-enabled
ln -s ../mods-available/rewrite.load rewrite.load

3). Now open the folder "/etc/apache2/sites-available"
Command:
cd /etc/apache2/sites-available

4). Make the "AllowOverride none" to "AllowOverride All" of the file "default"
sudo gedit default

5). Open your .htaccess file of your drupal site:

6). Look for the following line (line 100 on Drupal 7.4 .htaccess file):
# RewriteBase /drupal
Uncomment this line and change the "/drupal" to match your subfolder. In my case, since Drupal was installed on a folder named "/public_html/kaushal", I changed so:
RewriteBase /kaushal

7). Try enabling Clean URLs again. You should now see the checkbox "Enable Clean URLs" available.

bacarndiaye’s picture

Thank a lot its work for me :)

Esko’s picture

Just uncommenting 'RewriteBase /' in the '.htaccess' file is all that is needed.

  # uncomment the following line:
  RewriteBase /
Towhid001’s picture

I learned Wordpress. But Now I want to learn Drupal. but I don't know what is the difference between them. Please tell me someone.

sadanand kenganal’s picture

Very simple
1. Goto .htaccess file in your drupa7 folder(ie your project folder. it may in in www/drupal_project/ or public_html/drupal_project/).

2. .htaccess is a hidden file. So go to this this directory structure www/your_project/(or public_html/your_project/) and press ctrl+h.

3. You will get all hidden files including .htaccess file.

4. in .htaccess file, go to line number 106

5. #RewriteBase /drupal uncomment this line. Replace drupal by your project folder.

6. If you are not administrator or if you have an account and you working from that account, specify like this,
#RewriteBase /~username/your_project_folder

7. Save the file

8. Go to admin/config/search/clean-urls this page.

9. If everything is ok, you will get Enable clean URLs checkbox.

10. Enable it and now you have clean URL in your site.

Thank you.

Gilneas’s picture

I'm using Drupal since one of the early 6.x versions. I was always using it on a small 1&1 web package.
To be honest I also did have some issues... But anyway, it was each time like it took me a while, where I was patient and then found a fix.

I read lots of topics where someone is complaining about how poor 1&1's compatibility is for Drupal. Welcome to real life, there's no guide to success for each solution on every server.

My notes for a solution with 1&1:
* Use the .htaccess file below, but read these notes first
* The file below works with my 6.x MultiSite and my 7.x MultiSite instances
* I do use a basic managed web package, in other words the cheapest for my requirements
* The .htaccess file needs to be put into the Drupal's root folder
* Afterwards use your 1&1 console to point a domain to the Drupal folder
* Wait 10-15 mins for the changes (if no changes are necessary, change something and point your domain back to the Drupal folder) to be applied
* Saying it twice, be patient! The changes are necessary, to have some config in background of 1&1 updated (just guessing, but this would explain why some users saying they don't know what exactly they have done to fix it)
* Enjoy CleanUrls with 1&1
* Let's see what changes for Drupal 8.x or 9.x

So hopefully this saves some lazy time for other guys. If so, please add a comment for others to tell them a solution does exist, to stop them from struggling through the w³ searching for a solution.

/edit:
Just a side note: Ensure your upload was successful. I've often seen people uploading their .htaccess failing and they didn't recognize it, as their Ftp program didn't complain about permissions that noisly. Probably best ist to rename / delete old file and then do the upload.
/edit

Here's my .htaccess to success:

#AddType x-mapp-php5 .php
#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
  Order allow,deny
</FilesMatch>

# 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.
<Files favicon.ico>
  # There is no end quote below, for compatibility with Apache 1.3.
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

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

  <FilesMatch \.php$>
    # 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
  </FilesMatch>
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # 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/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [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 and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [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 /

  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

# $Id$
audiomax’s picture

This worked for me on Drupal 7 with 1and1

hyerk’s picture

Using Drupal 7.38. Uncommenting RewriteBase / worked for me.

Anonymous’s picture

I used 'Rewritebase /' and it got the site working - Am using a 1&1 Managed dedicated box.