Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Server Platforms
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

Server Platforms
Discussion regarding any server based ubuntu release.

 
Thread Tools Display Modes
Old December 19th, 2007   #1
Zarathu
Just Give Me the Beans!
 
Join Date: Jul 2006
Beans: 79
mod_rewrite loaded but not working

I have seriously followed every online tutorial and nothing is working at all. I know that mod_rewrite is loaded, but it doesn't give a rat's *** about the .htaccess

Here are some configs:

apache2.conf:
http://www.thesarcasm.com/paste.php?id=2341125

/var/www/.htaccess: (the root of my PHP files)
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST}   ^myusername\.homeunix\.com$
RewriteRule ^/(.*)         http://google.com/$1 [L,R]
/etc/apache2/sites-enabled/000-default:
http://www.thesarcasm.com/paste.php?id=7271524

Code:
root@jesus:/etc/apache2# ls -l mods-available/ mods-enabled/ | grep "rewrite"
-rw-r--r-- 1 root root   66 2007-08-16 17:45 rewrite.load
-rw-r--r-- 1 root root 233 2007-12-19 21:00 rewrite.load
root@jesus:/etc/apache2#
mods-available/rewrite.load:
Code:
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
mods-enabled/rewrite.load:
Code:
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^myusername\.homeunix\.com$ http://www.google.com [R]
</IfModule>
Any ideas?
Zarathu is offline   Reply With Quote
Old December 19th, 2007   #2
jjross
A Carafe of Ubuntu
 
jjross's Avatar
 
Join Date: Apr 2005
Location: Waldport, Oregon
Beans: 119
Ubuntu 9.04 Jaunty Jackalope
Send a message via Yahoo to jjross
Re: mod_rewrite loaded but not working

read this link and it should explain what is going on with your
.htaccess
it is ignored until you change your httpd file to allow it to use it
Here is another good link with even better information
http://www.javascriptkit.com/howto/htaccess.shtml
__________________
It is okay to change one's mind. It could even be wise to do so.
ross100.com

Last edited by jjross; December 19th, 2007 at 11:44 PM..
jjross is offline   Reply With Quote
Old December 19th, 2007   #3
Zarathu
Just Give Me the Beans!
 
Join Date: Jul 2006
Beans: 79
Re: mod_rewrite loaded but not working

Odd.

Alright, so I put "AllowOverride AuthConfig" in the /var/www <Directory>.

Now, if I have even the slightest thing in my /var/www/.htaccess, it gives a 500 response code and says "<Whatever> is not allowed here." in the error.log.
Zarathu is offline   Reply With Quote
Old December 19th, 2007   #4
jjross
A Carafe of Ubuntu
 
jjross's Avatar
 
Join Date: Apr 2005
Location: Waldport, Oregon
Beans: 119
Ubuntu 9.04 Jaunty Jackalope
Send a message via Yahoo to jjross
Re: mod_rewrite loaded but not working

i just found this
Quote:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

The all directive allows all directives to be placed within an .htaccess file

about line 328 you will find:

# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

AccessFileName defines what the access filename will be ...I imagine you can name it anything you want but .htaccess is the norm.
I think you need to change it to "all"
__________________
It is okay to change one's mind. It could even be wise to do so.
ross100.com
jjross is offline   Reply With Quote
Old December 20th, 2007   #5
Zarathu
Just Give Me the Beans!
 
Join Date: Jul 2006
Beans: 79
Re: mod_rewrite loaded but not working

This is from RewriteLog:

http://www.thesarcasm.com/paste.php?id=7199137

I got it reading from the .htaccess file now, which is great.

.htaccess:
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.myusername\.homeunix\.com$ myusername.homeunix.com/blog/$1/index.php

Still not working, though. :/
Zarathu is offline   Reply With Quote
Old December 20th, 2007   #6
Zarathu
Just Give Me the Beans!
 
Join Date: Jul 2006
Beans: 79
Re: mod_rewrite loaded but not working

Resolved. I win.

Code:
me > mod_rewrite
Zarathu is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:42 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry