Forum Moderators: phranque
I have the following information in /etc/http/conf.d/mod-rewrite.conf:
RewriteEngine On
RewriteLog "/var/log/httpd/rewrite_engine_log"
RewriteLogLevel 3
RewriteRule ^alice.html$ bob.html
I know it is being loaded by httpd since it picks up on syntax errors and the log file is being created.
I have the following in my /etc/http/conf/httpd.conf:
<Directory "/home/*/html">
Options FollowSymLinks
AllowOverride FileInfo
Allow from all
Order deny,allow
</Directory>
I have read that I need FollowSymLinks and FileInfo?
I made the files alice.html and bob.html and put them in my [host.com...] directory. When I load alice.html it still gives me alice.html.
The most bothersome thing is that I don't get anything in my log file. I have tried all kinds of log levels. The file remains empty. I have also tried using the .htaccess approach with no luck.
My real goal is to force https for a couple of urls, but I clearly cannot get past step 1 here. I apologize in advance if I am doing something stupid or if this is in a FAQ somewhere. Any suggestions would be greatly appreciated.
thanks, mark
The fact that nothing is being logged is bothering me. At a debugging level I would have thought that I would see things like "RewriteEngine is on" and "Entering RewriteRule #*$!", etc. Is it possible that there are problems with permissions?
thanks, mark
/etc/http/conf/httpd.conf:
<Directory "/var/www/html">
Options FollowSymLinks
AllowOverride FileInfo AuthConfig
Allow from all
Order allow,deny
</Directory>
/etc/http/conf.d/mod-rewrite.conf:
RewriteLog "/var/log/httpd/rewrite_engine_log"
RewriteLogLevel 3
/var/www/html/testdir/.htaccess:
RewriteEngine On
RewriteRule ^alice.html$ bob.html
Now I am trying to do what I orginally set out to do, to force my phpMyAdmin install to load in https.
I have an alias set:
Alias /mysql "/var/www/phpMyAdmin-2.8.0.2"
Then my .htaccess file in /var/www/phpMyAdmin-2.8.0.2 is as follows:
RewriteEngine On
RewriteCond %{HTTPS}!=on
RewriteRule ^/mysql/(.*) [%{SERVER_NAME}...] [R,L]
This is unfortunately not working. The logs are showing things like the following:
IPADDR - walter [26/Mar/2006:03:34:15 --0500] [oak.eng.ohio-state.edu/sid#8f96780][rid#9155188/initial] (1) [per-dir /var/www/phpMyAdmin-2.8.0.2/] pass through /var/www/phpMyAdmin-2.8.0.2/
This seems to indicate that it does not deal with the alias properly? Any suggestions?
thanks, mark
config:
RewriteRule [b]^/my[/b]sql/(.*) https://%{SERVER_NAME}/mysql/$1 [R,L]
.htaccess
RewriteRule [b]^my[/b]sql/(.*) https://%{SERVER_NAME}/mysql/$1 [R,L]
The requested local-URL-path 'seen' by RewriteRule in a per-directory (.htaccess) context is localized, i.e. stripped of the directory prefix used to get to this .htaccess file's directory -- in this case, "/".
Jim
Here is what I am now using. I could have multiple .htaccess files, but I have one in /var/www/ with the following information:
RewriteEngine On
RewriteCond %{SERVER_PORT}!443
RewriteRule ^html/SiteBar/(.*)$ [%{SERVER_NAME}...] [R,L]
RewriteCond %{SERVER_PORT}!443
RewriteRule ^phpMyAdmin-2.8.0.2/(.*)$ [%{SERVER_NAME}...] [R,L]
RewriteCond %{SERVER_PORT}!443
RewriteRule ^html/egroupware/(.*)$ [%{SERVER_NAME}...] [R,L]
RewriteCond %{SERVER_PORT}!443
RewriteRule ^html/gallery/(.*)$ [%{SERVER_NAME}...] [R,L]
As you can see, I had some trouble with the mysql rule. I tried using RewriteBase, to take care of the alias, but it didn't work. This seemed like a reasonable solution.
Thanks again for you generous help. regards, mark
RewriteEngine on
#
RewriteCond %{SERVER_PORT} !443
RewriteRule ^html/(SiteBar¦egroupware¦gallery)/(.*)$ https://%{SERVER_NAME}/$1/$2 [R,L]
#
RewriteCond %{SERVER_PORT} !443
RewriteRule ^phpMyAdmin-2.8.0.2/(.*)$ https://%{SERVER_NAME}/mysql/$1 [R,L]
Change all broken pipe "¦" characters to solid pipes before use; Posting on this board modifies them.
Jim