Results 1 to 11 of 11
-
06-18-2005, 09:27 PM #1Newbie
- Join Date
- Jan 2005
- Posts
- 18
need help, confused about .htaccess behaviour
I am needing to do a simple redirect from my new apache server.
When I hit the domain at root level I get the standard redirection to the apache2-default/
What I want is for anyone hitting the domain to get redirected to the portal page which is at /var/www/mxBB/index.php
I understand that an .htaccess file with:
Code:redirect / http://www.mydomain.com.au/mxBB/
I have tried
Code:redirect /var/www/ http://www.mydomain.com.au/mxBB/
Code:redirect /index.html http://www.mydomain.com.au/mxBB/index.php
What am I doing wrong? i must be missing something critical - is the .htaccess file not even getting read? Is there something overriding it? The .htaccess file is:
/var/www/.htaccess
TIA
*.
-
06-19-2005, 02:49 PM #2ThirtySx Bits Forever!
- Join Date
- Jul 2001
- Location
- Canada
- Posts
- 1,284
Almost right. I think what you may be looking for is this:
redirect 301 / http://www.mydomain.com.au/mxBB/"Obsolesence is just a lack of imagination."
-
06-19-2005, 10:03 PM #3Newbie
- Join Date
- Jan 2005
- Posts
- 18
Thanks for the advice, unfortunately it still doesn't work. Is it possible that .htaccess is not getting read somehow?
Is this an apache config issue?
when I have .htaccess as you describe in /var/www/.htaccess
and hit mydomain.com.au/ or mydomain.com.au/index.html
i don't get any different behaviour.
-
06-24-2005, 08:34 AM #4Newbie
- Join Date
- Jan 2005
- Posts
- 18
No .htaccess files are having any effect in any of the directories of my server. All other web behaviour is normal !!!
Is there some config that causes apache to ignore .htaccess??
Please can someone help me here please
-
06-24-2005, 11:14 AM #5Junior Guru Wannabe
- Join Date
- Jun 2005
- Posts
- 89
You could try this...
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)mxBB/$1 [QSA]
You will need to test it carefully
-
06-24-2005, 12:39 PM #6rogue element
- Join Date
- Jun 2004
- Location
- Northwest Colorado
- Posts
- 4,636
Originally posted by stardotstar
Is there some config that causes apache to ignore .htaccess??
Code:# # This controls which options the .htaccess files in directories can # override. Can also be "All", or any combination of "Options", "FileInfo", # "AuthConfig", and "Limit" # AllowOverride All
Eric J. Bowman, principal
Bison Systems Corporation coming soon: a new sig!
I'm just a poor, unfrozen caveman Webmaster. Your new 'standards' frighten, and confuse me...
-
06-25-2005, 08:54 AM #7Newbie
- Join Date
- Jan 2005
- Posts
- 18
Thank You BigBison,
I have parsed my httpd.conf file and found only this section when searching for .htaccess
Code:DirectoryIndex index.html index.cgi index.pl index.php index.xhtml # UserDir is now a module #UserDir public_html #UserDir disabled root #<Directory /home/*/public_html> # AllowOverride FileInfo AuthConfig Limit # Options Indexes SymLinksIfOwnerMatch IncludesNoExec #</Directory> AccessFileName .htaccess <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> UseCanonicalName Off TypesConfig /etc/mime.types DefaultType text/plain
Kamate - I don't understand your suggestion at all - where does this instructions go?
Will *.*(Thanks for the help - guys I am still at a loss)
-
06-25-2005, 02:16 PM #8ThirtySx Bits Forever!
- Join Date
- Jul 2001
- Location
- Canada
- Posts
- 1,284
#<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options Indexes SymLinksIfOwnerMatch IncludesNoExec
#</Directory>"Obsolesence is just a lack of imagination."
-
06-25-2005, 11:28 PM #9Newbie
- Join Date
- Jan 2005
- Posts
- 18
Thank you NyteOwl, that is invaluable and yes I am reading the manuals - just a little swamped with the scale of the information.
-
06-25-2005, 11:52 PM #10Newbie
- Join Date
- Jan 2005
- Posts
- 18
This section was actually in the apache2.conf file... I understand that httpd.conf is still supported but I know that uncommenting the section in apache2.conf is the correct config file because I changed the:
Code:DirectoryIndex index.html index.cgi index.pl portal.php index.php index.xhtml
Having uncommented the section mentioned though the .htaccess files are still having no effect - this is the .htaccess I have in the server root - which still redirects to apache2-default automatically (ignoring the .htaccess as far as I can tell):
Code:/var/www/.htaccess stardotstar@helios:/etc/init.d$ cat /var/www/.htaccess RedirectMatch 301 / http://www.mydomain.com.au/phpBB2/
Will.*
-
06-26-2005, 01:23 AM #11Newbie
- Join Date
- Jan 2005
- Posts
- 18
OK, I have sorted it all out =- thanks for the pointers - I had to delve into the virtual server conf files and set the RedirectMatch...
Things have been sorted out in the actual conf now rather than using .htaccess to reduce server load.
Thanks for all the help.
Will.* :-)