![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
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.
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Networking & Wireless Having problems getting connected to the internet or getting your wireless card to work? Ask here. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
5 Cups of Ubuntu
![]() Join Date: Jun 2006
Beans: 37
|
How to enable mod_rewrite in Ubuntu server??
I'm trying to find the right way/file to enable mod_rewrite. I know the typical place to do this is in httpd.conf, but of course Ubuntu has its own funky way of doing this with the mods-available and sites-available conf files.
What's the official way to enable mod_rewrite on Ubuntu? |
|
|
|
|
|
#2 |
|
Gee! These Aren't Roasted!
![]() Join Date: Jul 2006
Beans: 158
|
Re: How to enable mod_rewrite in Ubuntu server??
I assume you are talking about Apache2 directory structure for Ubuntu. This is the new and modular way all distributions will be laying out their Apache2 server config.
Mod_rewrite is compiled in by default. You can see it in the /etc/apache2/mods_available directory. If you feel like making doubly sure that it is loaded then simply put the following directive into httpd.conf: Code:
LoadModule mod_rewrite /usr/lib/apache2/modules/mod_rewrite.so Code:
sudo apache2ctl -l
__________________
..share what you know ..learn what you do not |
|
|
|
|
|
#3 |
|
5 Cups of Ubuntu
![]() Join Date: Jun 2006
Beans: 37
|
Thanks!
I actually found the following command that did the trick:
Code:
a2enmode rewrite |
|
|
|
|
|
#4 |
|
First Cup of Ubuntu
![]() Join Date: Sep 2006
My beans are hidden!
|
Re: How to enable mod_rewrite in Ubuntu server??
And for future references, the "correct" way to define a new site (such as a new virtual host) is to create the definition in /etc/apache2/sites-available in its own file and then call:
Code:
a2ensite conf_file_name |
|
|
|
|
|
#5 |
|
5 Cups of Ubuntu
![]() |
Re: Thanks!
|
|
|
|
|
|
#6 |
|
5 Cups of Ubuntu
![]() Join Date: Mar 2006
Beans: 19
|
Re: Thanks!
I'm also looking for a way to enable the rewrite mod to apache2.
i ran the commmand a2enmod rewrite and it said that the mod was addess successfully, but i can't see it in the list when i type: sudo apache2ctl -l I've tried to make a rewirie rule to test but i'm not sure how to do it. This is what i've done: In apache2.conf: Code:
<IfModule mod_rewrite.c> RewriteEngine On </IfModule> Code:
RewriteEngine on RewriteRule /page/([0-9]+) /page.php?page=$1 |
|
|
|
|
|
#7 |
|
Spilled the Beans
![]() Join Date: Nov 2005
Beans: 14
|
Re: How to enable mod_rewrite in Ubuntu server??
I am having the same problem.
mod_rewrite is enabled Code:
a2enmod rewrite Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/(.*) http://localhost:8080/$1 [P]
</IfModule>
|
|
|
|
|
|
#8 |
|
5 Cups of Ubuntu
![]() Join Date: Mar 2006
Beans: 19
|
Re: How to enable mod_rewrite in Ubuntu server??
I've found out the solution!
Change AllowOverRide None in /etc/apache/sites-available/default to AllowOverRide All(or something else, but not None). Apache won't read the rewrite rules nor the .htaccess-files if AllowOverRide is set to None. Hope that helps you too! Last edited by Pekz0r; September 4th, 2007 at 03:50 AM.. |
|
|
|
|
|
#9 |
|
Spilled the Beans
![]() Join Date: Nov 2005
Beans: 14
|
Re: How to enable mod_rewrite in Ubuntu server??
still doesn't work
thanks for your help though |
|
|
|
|
|
#10 |
|
5 Cups of Ubuntu
![]() Join Date: Mar 2006
Beans: 19
|
Re: How to enable mod_rewrite in Ubuntu server??
Is mod_rewite in the list loaded modules in phpinfo()?
Try putning the rewrite rules in a -htaccess file, that works for me |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|