How can I enable clean URLs without HTACCESS?
Has anyone been sucessful in this? I'm using UBUNTU 8.04 and Drupal 6.19.
THANKS.
7 Replies
I take the same lines out of htaccess and put them in with Apache file? I'm on Ubuntu 8.04 and Apache2. I see a couple configuration files:
httpd.conf
ports.conf
apache2.conf
Those are all in the /etc/apache2 directory. Is that even the right place to look for my server configuration file?
/etc/apache2/sites-available/default
There'll be a section that begins with
You put your rewrite rules inside those tags.
@theatereleven:
Thanks - could you expound on that a touch?
Read this
There is a common misconception that .htaccess files must be used, be in reality anything in .htaccess can go in your configuration file.
> When should I, and should I not use .htaccess files?
Allowing .htaccess files will make Apache look for them upon every access to your server. Since parent directories are searched as well, this will take some (small) amount of time, and can impact your server's performance. For a better explanation, see HtaccessGotchas. (move that explanation here?)
Should use
.htaccess files should really only be used when you cannot directly edit the main configuration files.
Should not use
You should not use .htaccess when:
* 1. you have access to edit the main server configuration file(s).
2\. server performance is of concern to you. 3\. untrusted people host websites on the server. (See How can I prevent users from using .htaccess? and How can I control what users can do with .htaccess files? (How to link to headings of this doc????))</list></quote></r>
I have only one Drupal site and one instance of Apache2 installed in the normal places.
I took the rewrite rules out of .htaccess and put them in the directory area of /etc/apache2/sites-available/default but it didn't work. bummer! Here are the rewrite rules I tried:
Set one:
Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Those didn't work so after reading another article i tried:
RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{DOCUMENTROOT}%{REQUESTFILENAME} !-f
RewriteCond %{DOCUMENTROOT}%{REQUESTFILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
And of course was reloading and restarting Apache each time. These didn't work for me. Any tips on what I might have wrong? THANKS.
I don't think %{SERVER_PORT} would be relevant here. The port is usually specified in the
Try adding a slash between %{DOCUMENTROOT} and %{REQUESTFILENAME}.
You might have to play with a RewriteBase configuration.
Check /var/log/apache2/error.log for any errors.
What else…?
There is one other site specified in sites available that I just added. "monitor.servername.com" for use with munin monitoring.
I'm just so new to this stuff I don't even know what to mess with when it comes to these rewrite variables. I have a very vanilla drupal 6.19 installation. One site, one domain name, etc.