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 5th, 2004   #1
Crisp
5 Cups of Ubuntu
 
Join Date: Nov 2004
Location: England
Beans: 31
Send a message via AIM to Crisp Send a message via MSN to Crisp
mod_rewrite

Hi

I installed Apache/MySQL/PHP4 and it's all working fine. However, I now have a need to enable/install mod_rewrite. This is the first real experience I've had setting up Apache, usually I just use a hosted environment.

Could someone walk me through enabling or installing mod_rewrite please?

Thanks

-Crisp
Crisp is offline   Reply With Quote
Old December 6th, 2004   #2
Hikaru79
Gee! These Aren't Roasted!
 
Hikaru79's Avatar
 
Join Date: Dec 2004
Location: Waterloo Ontario (Canada)
Beans: 171
Kubuntu 5.10
Send a message via AIM to Hikaru79 Send a message via MSN to Hikaru79 Send a message via Yahoo to Hikaru79
Re: mod_rewrite

A quick google search turned this up: http://httpd.apache.org/docs/mod/mod_rewrite.html

If that's not comprehensive enough, I don't know what is ^ ^;;
__________________
I seem to have discovered a truly remarkable proof for Fermat's Last Theorem, which this siggie is too small to contain.
Hikaru79 is offline   Reply With Quote
Old December 6th, 2004   #3
Crisp
5 Cups of Ubuntu
 
Join Date: Nov 2004
Location: England
Beans: 31
Send a message via AIM to Crisp Send a message via MSN to Crisp
Re: mod_rewrite

Quote:
Originally Posted by Hikaru79
A quick google search turned this up: http://httpd.apache.org/docs/mod/mod_rewrite.html

If that's not comprehensive enough, I don't know what is ^ ^;;
Yeah I've been there, the problem is it's a little too comprehensive, I just want a quick and easy setup. I don't need the ins and outs of every last part of it and how to use it.

-Crisp
Crisp is offline   Reply With Quote
Old March 8th, 2005   #4
Levander
Way Too Much Ubuntu
 
Join Date: Jan 2005
Beans: 225
Re: mod_rewrite

Quote:
Originally Posted by Crisp
Yeah I've been there, the problem is it's a little too comprehensive, I just want a quick and easy setup. I don't need the ins and outs of every last part of it and how to use it.

-Crisp
Realize this post is a little old, but may help if I answer it?

sudo a2enmod rewrite

Adds a .load file to /etc/apache2/mods-enabled/ that loads the module.

Then, you have to make sure that RewriteEngine on is somewhere in your Apache configuration. WordPress 1.5 inserts the RewriteEngine directive in the .htaccess file in the directory where WordPress is installed. I'm sure in apache2.conf would be fine to. Looks something like this:

<IfModule mod_rewrite.c>
RewriteEgine On
</IfModule>
Levander is offline   Reply With Quote
Old September 6th, 2005   #5
invalid
Has an Ubuntu Drip
 
invalid's Avatar
 
Join Date: Mar 2005
Location: Melbourne, FL. USA
Beans: 577
Gutsy Gibbon Testing
Re: mod_rewrite

Again, a reply to an old post, but this has helped me out - and I just wanted to correct a typo in the last reply, incase someone is not able to determine the error printed by apache..

It should be:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
Cheers,
Cb
invalid is offline   Reply With Quote
Old September 20th, 2005   #6
neocon2005
5 Cups of Ubuntu
 
Join Date: Jun 2005
Location: Sugar Land, TX
Beans: 17
Re: mod_rewrite

Thank you very much for the answer. Worked very well for me. Goes to show that even though the reply was delayed, it can still be useful for people searching for information at a much later date - people like me!!!
neocon2005 is offline   Reply With Quote
Old October 25th, 2005   #7
markthecarp
A Carafe of Ubuntu
 
markthecarp's Avatar
 
Join Date: Apr 2005
Location: piedmont-triad, nc usa
Beans: 108
Ubuntu 9.10 Karmic Koala
Send a message via AIM to markthecarp
Re: mod_rewrite

Quote:
Originally Posted by Levander
Realize this post is a little old, but may help if I answer it?

sudo a2enmod rewrite

Adds a .load file to /etc/apache2/mods-enabled/ that loads the module.
This worked for me. It created the file /etc/apache2/mods-enabled/rewrite.load which turns out to be a sym link.
Code:
mark@tuna:/usr/share/gallery/css$ ll /etc/apache2/mods-enabled/rewrite.load
lrwxrwxrwx  1 root root 40 2005-10-24 21:03 /etc/apache2/mods-enabled/rewrite.load -> /etc/apache2/mods-available/rewrite.load
Quote:
Then, you have to make sure that RewriteEngine on is somewhere in your Apache configuration. WordPress 1.5 inserts the RewriteEngine directive in the .htaccess file in the directory where WordPress is installed. I'm sure in apache2.conf would be fine to. Looks something like this:

<IfModule mod_rewrite.c>
RewriteEgine On
</IfModule>
I found this in /etc/gallery/htaccess.
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /gallery/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)/([0-9]+)$      /gallery/view_photo.php?set_albumName=$1&index=$2       [QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)/([A-Za-z_0-9\-]+)$     /gallery/view_photo.php?set_albumName=$1&id=$2  [QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)/$      /gallery/$1     [R]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.\?/]+)$       /gallery/view_album.php?set_albumName=$1
[QSA]
</IfModule>
I find no directive for the mod_rewrite in /etc/apache2/apache2.conf. I'm using an Athlon Duron 1.3ghz, 256M ram, 2x10 gig hd's. Running breezy, apache2, gallery1.5 to host a dyndns.org home site.

-mark
__________________
--that's carpenter, not the nasty fish...
markthecarp is offline   Reply With Quote
Old November 12th, 2005   #8
Todd_Z
Just Give Me the Beans!
 
Todd_Z's Avatar
 
Join Date: Nov 2005
Beans: 46
Re: mod_rewrite

Code:
/etc/init.d/apache2 start
 * Starting web server (Apache2)...                                      [fail]
I used the sudo a2enmod rewrite command it enabled it properly, but now apache2 wont start.... any ideas?
Todd_Z 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 11:12 PM.


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