By lochen on
Hello,
i want to use the clean urls function, but in General settings->Clean URLs, it is disabled for choose "Disabled" or "Enabled", why ?
now in my site,all linking like this -> index.php?q=xxxx/xxxx
how can i hidden the "index.php" in my site ? make it like drupal.org site -> http://webiste.com/xxx/xxx
thank you
Comments
Clean URLs work on Apache
Clean URLs work on Apache Server. But if you have
index.phpin your urls it means you are not on an Apache server.Let's say you have Apache, then you should click "Run Clean URL test" link in the description of disabled
Enable, Disableradio buttons. If you pass the test, you can selectEnable. A Not Found page or a blank page or your frontpage shows that you cannot use Clean URLs.--------------------------------------------------------------
http://erdemkose.com/
Thank you for your reply,i
Thank you for your reply
If i use IIS ? not use apache.
http://drupal.org/node/3854
i according to this article to set, but it not work.
http://10.1.8.38/drupal/admin/settings
it will display
"No input file specified. "
how can i solve it ? thank you
Index.php is not Apache
You said that
I don't understand how you say that. Just as an example, I looked at my install of XAMPP which uses Apache and there is an index.php file right in the root directory of htdocs. It's the home page of the XAMPP system.
I didn't say that you
I didn't say that you shouldn't have index.php file but I said you shouldn't have index.php in your URLs.
URLs on
--------------------------------------------------------------
http://erdemkose.com/
Not true on my machine, still can't get those clean URLs
I am using Apache and I get http://server/index.php?q=node/5 not http://server/?q=node/5, so I am not sure that what erdemkose is saying is true in all situations (that index.php doesn't show up using Apache). I am on windows, not linux though, not sure if that would change things, also using Apache 2.0.59.
Still working on getting those clean URLs though.
What I know:
Using WAMP, putting the AddModule mod_rewrite.c in my Apache httpd.conf causes an error that prevents my server from working. According to other posts in this forum, WAMP setups have no mod_rewrite.c module to load. Of course, everything in the .htaccess file in my site is based on there being a mod.rewrite.c module added (ie. the command IfModule mod_rewrite.c). So the forums suggest to comment out this if statement, as in the following:
# <IfModule mod_rewrite.c>[ Rewrite conditions and rules here...]
# </IfModule>That just caused my entire site to return the message that the configuration settings in my Apache server were wrong. I went and tried to get back to the previous settings where at least my non-clean URLs would work, and ended up with a message saying I don't have access to the server. So I figured I missed something, and since this was all in my local testing environment, I simply copied the .htaccess file down from my live server.
This worked in getting me back to where I thought I started. But now, in my local testing server, clean URLs worked for the first time! So I have all of my original settings in my drupal directory, and the things I changed in my Apache httpd.conf are as follows:
uncommented the LoadModule rewrite_module modules/mod_rewrite.so
changed the AllowOverride None to Alloverride All whereever I could find it, which now looks like:
<Directory />Options FollowSymLinksAllowOverride All</Directory>and further down the page (after some comments about "AllowOverride controls what directives may be placed in .htaccess files...):
AllowOverride All
But this doesn't work on my live site and I don't have access to the httpd.conf file (it is running Apache). Is there anything I can do in the directory to make it work, maybe in the .htaccess file, or do I need to talk to my hosting company and get them to update the httpd.conf file in the apache server?
Still can't get those clean URLs
Rereading the comments in the httpd.conf file, I see that the first occurence of "AllowOverride None" (line 240) should NOT be changed.
You set the DocumentRoot and set the root directory to "None" as default. Then you explicitly set the Directory to the "www" directory (which is also the root directory in this case) and set explicit permissions, including "AllowOverride All" (line 274). In this case, explicit is better than implicit. That works on my WAMP server.
The important part of the .htaccess file is:
# Various rewrite rules.
#
RewriteEngine on
...
(other rules all commented out except Rewrite Base, if needed)
...
# 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]
#
Note: BOTH the AND the lines are commented out.
I haven't retested it on my ISP server (Globat, shared Linux) and I suspect that it may not work because they
1. Do not allow access to httpd.conf "for security reasons" and they claim that AllowOverride is NONE.
2. Only use .htaccess files for redirection from the root directory of the server, not from subaccounts where I am running for testing purposes. So until I convert my main directory to Drupal, I won't know. If it still doesn't work, I'll know that I have to find another ISP if clean URLs are important for SEO purposes.
Try uninstalling Java
Try uninstalling Java if you don't need it.
I recently set up a couple of LAMP based drupal sites, on seperate shared servers, and couldn't get the clean urls to work on either one for the life of me. On one, I wanted to test out some Ruby apps and discovered that in order to do so I needed to uninstall Java - and since I wasn't running any Java apps I did. Much to my surprise, I later noticed that I was able to check the "enable" option for Clean URL's, successfuly ran the test and... voila. Working like a charm. I then uninstalled Java on the other server and again... clean urls's are working like a charm.
No need to access httpd.conf or .htaccess (if you already hacked these files trying to enable clean urls, I'd recommend removing the hacks.)
Hope this helps.
Very useful reply for my local Drupal installation, thanks
A bit late, but it helped me for my local Drupal installation : I was stuck with my local .htaccess.
I just had to change
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
with :
RewriteRule ^(.*)$ http://localhost/mydrupalsite/?q=$1 [L,QSA]
to make it work.
Thanks to everyone sharing time on this forum
Clean URL may not work with some webhosts
I posted a similar question recently drupal.org/node/75797. Supposedly for "security" reasons on a shared server, even though "mod_rewrite" IS enabled, "AllowOverrides" is NOT and I have no access to httpd.conf on Apache. The webhost even recommends using mod_rewrite for redirection and preventing "bandwidth theft" and gives the .htaccess coding to enable this. Of course they don't support Drupal; they offer Mambo. If anyone can explain why clean URL isn't working, I would be grateful.
I feel like I'm chasing my tail
After 4 phone calls to Tech Support at my webhost (Globat) I was finally informed that .htaccess files do not work on a subaccount, which is where I was testing my new Drupal site. They only work in the main httpdocs directory of the main account. If that's true, than that explains why my mod_rewrite didn't work to give me clean URLs.
So I decided to do my development under WAMP on my local system. Now I have full control of Apache, PHP and MySQL. So I checked all the directives in httpd.conf:
AllowOverride all
LoadModule rewrite_module modules/mod_rewrite.so
BUT THERE IS NO AddModule mod_rewrite.c and the file is nowhere to be found in the WAMP directory.
Does this mean that I MUST use a Linux box in order to make the damn clean URLs work???
The Chase has Ended
this dog finally caught his tail.. 8-)
Once I realized that my WAMP setup had no mod_rewrite.c module to load, I simply commented out these two lines in the .htaccess file and the clean URLs worked...
# <IfModule mod_rewrite.c>
[ Rewrite conditions and rules here...]
# </IfModule>
FWIW, with the release of
FWIW, with the release of WAMPServer current as of this writing (Sept 2007), you simply need to select Apache Modules/rewrite_module from the system tray icon. The server will auto-restart, after that, you should be able to successfully complete the clean urls test and turn on clean urls.
That is to say: I did not find it necessary to alter the stock Drupal htaccess on my local install.
Thank for the tip. I still
Thank for the tip. I still got this problem though. I have thought that WAMPServer should have this module as its default, but it's not. (Apr 2009)
clean urls still disabled but able to view without ?q=
Hi I'm running a drupal site that will not allow the clean url settings to be enabled even though when I run the clean url test it works fine.
I am able to view the pages using clean url, but not able to set it in drupal so that it will use them by default. Has anyone else run into this?
~fayola
--------
http://www.fayola.net
if i'm not mistaken
Add the following line to the end of your sites/default/settings.php file:
Getting clean URLs to work is a two-step affair:
- first we have to ensure the server can handle the rewriting of URLs from their clean form to their current-style. This is why you can test clean urls (without the "?q=") without having enabled drupal to generate them first.
- secondly we actually tell drupal to start writing the link urls in clean form. We do this once we are confident that the web server can rewrite the url's properly - hence the test link in the administer > settings > "general settings" > "clean URLs" section.
as an aside, I'm flummoxed. clean URLs worked for me on 4.6.5 but not on 4.7.3 , using the same server, apache2.
WAMP + Clean URLs = simple answer
WAMP for the windows users out there is a very very easy set up and install...
the ability to turn on and off apache modules (to enable clean urls for the server, just of to traymenu/apache/apachemodules/rewrite) as well as being able to access the mysql c prompt from the traymenu is ultra cool
thanks for that very very cool tip ... which I forgot about until i needed it just now!
Oh my word, it's fixed.
I know this is an old thread, But I have been looking around trying to get this problem fixed on my local install and fixed it by this method. Clean urls are now working! Yay! The Drupal community is awesome.
Thanks
Very old post but helped me. thanks!!