View previous topic :: View next topic |
Author |
Message |
Kevin72594 Guru


Joined: 30 Dec 2003 Posts: 307
|
Posted: Fri Feb 10, 2006 11:22 pm Post subject: Drupal and Clean URLS (Apache/ModRewrite)[Solved] |
|
|
Does anyone have Clean URL's working in Drupal? When I attempt to enable support it claims that
Code: | "your host is not configured correctly for Clean URLs. Please check for ModRewrite support with your administrator." |
I have the following in my httpd.conf
Code: | LoadModule rewrite_module modules/mod_rewrite.so |
and the following in my drupal/.htaccess
Code: |
<IfModule mod_rewrite.c>
RewriteEngine on
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /sigep
# 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]<IfModule mod_rewrite.c>
RewriteEngine on
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /sigep
# 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]
</IfModule>
# 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]
</IfModule>
|
I am not sure if modrewrite support is enabled in apache by default but I would assume it is considering the httpd.conf has it by default. If anyone needs any more information or has any answer it would be extremely appreciated, thanks!
Kevin
Last edited by Kevin72594 on Sat Feb 11, 2006 5:57 pm; edited 1 time in total |
|
Back to top |
|
 |
gen2fox Guru


Joined: 25 May 2004 Posts: 544
|
Posted: Fri Feb 10, 2006 11:56 pm Post subject: |
|
|
Is the site in question the one in your profile? If so:
Code: | # Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /sigep |
Needs to be changed to:
Code: | RewriteBase /drupal |
_________________ python>>> q="'";s='q="%c";s=%c%s%c;print s%%(q,q,s,q)';print s%(q,q,s,q)
blog |
|
Back to top |
|
 |
Kevin72594 Guru


Joined: 30 Dec 2003 Posts: 307
|
Posted: Sat Feb 11, 2006 1:33 am Post subject: |
|
|
It is not the one in my profile, the site in question is Here. And that line should be correct on this site I believe.
Thank you for your suggestion though, if there are any others they ARE appreciated!!
Kevin |
|
Back to top |
|
 |
gen2fox Guru


Joined: 25 May 2004 Posts: 544
|
Posted: Sat Feb 11, 2006 11:59 am Post subject: |
|
|
Did you try to test mod_rewrite with a simple .htaccess to see if it's really working?
Code: | RewriteEngine On
RewriteRule ^test1.html$ /test2.html |
Your problem may have something to do with "AllowOverrirde", what is it set for the site's directory? Trying setting it to "All". _________________ python>>> q="'";s='q="%c";s=%c%s%c;print s%%(q,q,s,q)';print s%(q,q,s,q)
blog |
|
Back to top |
|
 |
Kevin72594 Guru


Joined: 30 Dec 2003 Posts: 307
|
Posted: Sat Feb 11, 2006 5:57 pm Post subject: |
|
|
AllowOverride was the problem, I set it in my httpd.conf to All for that directory and it now works!! Thank you so much for your help!
Kevin |
|
Back to top |
|
 |
lexington n00b


Joined: 10 Apr 2005 Posts: 25 Location: Cambridge, MA
|
Posted: Sat Apr 22, 2006 4:36 pm Post subject: |
|
|
Just thought I'd shine some light on this subject in a little more detail for those of you still not able to get CleanUrls working. My fix did not occur within httpd.conf, rather I fixed it within /etc/apache2/vhosts.d/00_default_vhost.conf. For me I needed to change AllowOverride to All under the htdocs directive which did not exist within httpd.conf. So if you can't find your directive in httpd.conf and you've tried making one and it still doesn't work, check that 00_default_vhost.conf file for the proper directive. Chances are the directive is listed there. If not and you already created one in httpd.conf to no avail, try creating one in the 00_default_vhost.conf file with the appropriate settings....that fixed it for me. Hope this helps!
~lexington |
|
Back to top |
|
 |
|