hi all,
I wanted to enable clean urls in my drupal installation ,but unfortunately when i run the check for it i get a 404 error. my host has enabled mod_rewrite . am i missing somethin ?
Quoth S.Theyagarajan:
my host has enabled mod_rewrite . am i missing somethin ?
Does your .htaccess file exist and does it contain the following? RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
If not, try creating the .htaccess file and placing this inside (it's not complete; you'll have to download Drupal for the full version).
If that doesn't work, try placing this (and only this) at the top of your .htaccess file: RewriteENGIIINE On (the typo is intentional; you might want to copy & paste) If your .htaccess file is being correctly read, you should see an 'internal server error' message. If you don't see an error at this stage, it means that your webserver isn't reading the .htaccess file; you'll need to ask your webhost to enable this.
Cheers,
Rob -- Rob Wilmshurst drupal@fifteenoclock.com
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
This one worked for me :-) thanks
Glad I could help. Should probably have explained what it does:
RewriteEngine On
Turns on mod_rewrite (providing it's been enabled in the apache configuration)
RewriteCond %{REQUEST_FILENAME} !-f
If the request is not for an existing file...
RewriteCond %{REQUEST_FILENAME} !-d
... or for an existing directory..
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
...then redirect everything to 'index.php' in the current folder, assigning the requested url to the 'q' variable. The [L,QSA] part tells mod_rewrite to skip any remaining rules (L for Last) and append a querystring, if any.
I'd recommend you take a look at the .htaccess from a default Drupal install; it's got a few extra rules that help with security (eg preventing access to .module files).
Cheers, Rob
-- Rob Wilmshurst rob@fifteenoclock.com
Glad I could help. Should probably have explained what it does:
RewriteEngine On Turns on mod_rewrite (providing it's been enabled in the apache configuration) RewriteCond %{REQUEST_FILENAME} !-f If the request is not for an existing file... RewriteCond %{REQUEST_FILENAME} !-d ... or for an existing directory.. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] ...then redirect everything to 'index.php' in the current folder, assigning the requested url to the 'q' variable. The [L,QSA] part tells mod_rewrite to skip any remaining rules (L for Last) and append a querystring, if any.
I'd recommend you take a look at the .htaccess from a default Drupal install; it's got a few extra rules that help with security (eg preventing access to .module files).
Cheers, Rob
-- Rob Wilmshurst rob@fifteenoclock.com
RewriteEngine On Turns on mod_rewrite (providing it's been enabled in the apache configuration) RewriteCond %{REQUEST_FILENAME} !-f If the request is not for an existing file... RewriteCond %{REQUEST_FILENAME} !-d ... or for an existing directory.. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] ...then redirect everything to 'index.php' in the current folder, assigning the requested url to the 'q' variable. The [L,QSA] part tells mod_rewrite to skip any remaining rules (L for Last) and append a querystring, if any.
I'd recommend you take a look at the .htaccess from a default Drupal install; it's got a few extra rules that help with security (eg preventing access to .module files).
That was really informative ,i have been using .htaccess witthout being able to understand .thanks rob :-)
thanks taggy http://theyagar.info ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ S.Theyagarajan Under Graduate Department Of Computer Science And Engineering National Institute Of Technology , Trichirapalli India 620015