Community

enabling clean urls for a virtual subdomain, by editing .htaccess ?

Hi

I am trying to enable clean urls for my drupal site (not multisite) on a virtual subdomain, by using this code.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index?q=$1 [L,QSA]

I have tried at least 30-40 variations on this code over the last two weeks, trying to accommodate suggestions made here: http://drupal.org/node/15365,
as well as elsewhere on the drupal and textdrive (my host) forums. Searching through the many forum posts on this topic on drupal.org, it seems as though almost all posts pertain to *multisite* installations, which is not the case with me.

My host is textdrive

Anyway, if anyone has any insight, or has herself accomplished this daunting feat, I would appreciate your help. Thanks

JK

Comments

(Subscribe)

(Subscribe)

Strange... I never needed to

Strange... I never needed to change anything in .htaccess for a subdomain installation. I just create a new settings subdirectory under 'sites', named "subdomain.domain.com", I edit the database line in its 'settings.php' file, and I am ready to go. I don't even change the 'base_url' setting inside the settings file.

Could it be a problem with your host's support of url rewrites? I think more information about your setup are needed before someone can figure out what is wrong.

What about httpd.conf?

I don't know your exact configuration but it is possible that you need to modify httpd.conf. Try:

<Directory "/path/to/your/dir">
AllowOverride All
</Directory>

Or, if it is not your own server then contact your ISP and ask if you can add rewrite handling code in .htaccess.

shared server dilemna

i guess the root of the problem is that I am on a 'shared server, and have no access to httpd.conf. i am awaiting information from my host -- in the meantime, thanks both for your replies.

JK

problem solved

but not by me. textdrive was gracious enough to help me out with this problem. Here is what they said:

AllowOverride All is in the httpd.conf. Adding it to your .htaccess will throw an error. Additionally, your .htaccess should be in your /web/public directory.

The issues with subdomains exist with the subdirectory-to-subdomain mapping (eg. where domain.com/folder = folder.domain.com). In your case, the subdomain is a full-fledged virtual server.

Looking at your settings (http://virtualserver.domain.com/?q=admin/settings), "Clean URLs" was set to Disabled. I've run the required to test and set the option to Enabled. As you can see, http://virtualserver.domain.com/node/4 is working fine now.

I am grateful to have this issue resolved, but don't still dont fully understand what caused the problem, and I know that until I understand why it happened I am vulnerable to it happening again when I create a new drupal site. Anyway, hope this helps someonewith same problem

JK

Yeah, that worked for me too...

If anyone comes across this problem, again, this worked for me.

Specifically: "Additionally, your .htaccess should be in your /web/public directory."

Once I moved the .htaccess file to the /web/public directory, it worked.

Hope this helps someone.

Erik.

http://quilted.org

Just wanted to let you know

Just wanted to let you know that those little lines made my setup work, after many many hours of testing. Thank you.

Didrik Nordström - web developer - Personal site (in Swedish) - My Twitter

you can try this..

uncomment the following line in your .htaccess

#RewriteBase / to RewriteBase /

cherankrish
http://corp.yaaldevi.com

Cherankrish

"uncomment the following line in your .htaccess
#RewriteBase / to RewriteBase /"

nobody click here