Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Drupal and Clean URLS (Apache/ModRewrite)[Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Kevin72594
Guru
Guru


Joined: 30 Dec 2003
Posts: 307

PostPosted: Fri Feb 10, 2006 11:22 pm    Post subject: Drupal and Clean URLS (Apache/ModRewrite)[Solved] Reply with quote

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
View user's profile Send private message
gen2fox
Guru
Guru


Joined: 25 May 2004
Posts: 544

PostPosted: Fri Feb 10, 2006 11:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Kevin72594
Guru
Guru


Joined: 30 Dec 2003
Posts: 307

PostPosted: Sat Feb 11, 2006 1:33 am    Post subject: Reply with quote

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
View user's profile Send private message
gen2fox
Guru
Guru


Joined: 25 May 2004
Posts: 544

PostPosted: Sat Feb 11, 2006 11:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Kevin72594
Guru
Guru


Joined: 30 Dec 2003
Posts: 307

PostPosted: Sat Feb 11, 2006 5:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
lexington
n00b
n00b


Joined: 10 Apr 2005
Posts: 25
Location: Cambridge, MA

PostPosted: Sat Apr 22, 2006 4:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum