mod_rewrite

Web hosting discussion, programming, and shared and dedicated servers.
5 posts Page 1 of 1
by Boz » Thu Mar 01, 2012 2:25 pm
I just installed a Drupal 7 site on your server (http://www.leffconstruction.com) and I want to use the "clean urls" feature, which allows me to remove unwanted characters from my urls. To do this, however, Drupal requires for mod_rewrite to be enabled.

Looking at my php info file (http://leffconstruction.com/info.php), it appears the module isn't enabled. Is there a way for me to get this module enabled so my site can work properly?

For example: this url does not work: http://www.leffconstruction.com/news

But this does: http://www.leffconstruction.com/index.php?q=news

I have spoken to two people on the phone at Sonic but they had no idea what I was talking about, and refused to let me speak to anyone who would understand the issue. Very frustrating.

Thanks for your help.
by Boz » Thu Mar 01, 2012 2:54 pm
Nevermind, I found a workaround in the htaccess file. If a mod could delete this post, that would be great. Prolly shouldn't have posted our php.info file :D

Thanks sonic.
by rodrigo » Thu Mar 01, 2012 2:58 pm
Hi there,

The module doesn't display in my phpinfo() readout either, but it is working.

The .htaccess file is what actually controls the url rewriting. mod_rewrite is an apache web server module (not related to php itself) and rewrite rules are defined and applied through .htaccess files. What you've got may not be a workaround, but the actual required setup. It needs to be set up something like:

Code: Select all

RewriteEngine on

RewriteRule .* index.php?q=$0 [PT]
This will make it so that site.com/foobar shows in the address bar for the end user, but the index.php file gets run, with the parameter of q as "foobar"
by bdornbush » Fri Aug 31, 2012 10:45 am
Boz,
What was the workaround in .htaccess that you found worked for Drupal 7? I have the same problem, and the standard .htaccess file shipped with Drupal 7 doesn't seem to work, even though it has worked fine for me in many other installations on other hosting services.
by bdornbush » Fri Aug 31, 2012 11:12 am
For my site, I found that I needed to uncomment

RewriteBase /

and then it worked.
5 posts Page 1 of 1

Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 8 guests