LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 03-17-2012, 06:02 AM   #1
suj
Member
 
Registered: Dec 2009
Posts: 33

Rep: Reputation: 1
mod rewrite


Hi all,

I have installed lamp in the server. All working fine. But mod-rewrite is not seesm to be enabled in the server. I have compiled it with the --enable-module=rewrite. But ut does not list in httpd -l.
I have created a .htaccess file with following data
===
Options +FollowSymLinks
Redirect /google.html http://www.google.com
===

And if i access it via mydomain.com/google.html it redirect to google.com as well. So is it enabled in the server?
Can anyone explain..

Last edited by suj; 03-17-2012 at 06:19 AM. Reason: missed something
 
Old 03-17-2012, 09:51 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Hi,

The Redirect directive is part of mod_alias and not mod_rewrite, so it works regardless of mod_rewrite support.
If you want to see if you have mod_rewrite support in apache, either as a static or a dynamic module, you should run:
Code:
httpd -M|grep rewrite
Regards
 
Old 03-17-2012, 10:13 AM   #3
suj
Member
 
Registered: Dec 2009
Posts: 33

Original Poster
Rep: Reputation: 1
I have compiled and installed apache to /usr/local/apache
so the command shows below
==
/usr/local/apache/bin/apachectl -M | grep rewrite
Syntax OK
==
 
Old 03-17-2012, 10:38 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
I have compiled and installed apache to /usr/local/apache
You should have posted the options used to ./configure
Quote:
/usr/local/apache/bin/apachectl -M | grep rewrite
Syntax OK
mod_rewrite is not compiled either as a DSO or a static module. Now I saw you used "--enable-module=rewrite". The correct option is "--enable-rewrite", or "--enable-modules=list of modules you want to enable".
You can go into the apache sources directory and run the following commands in this order
Code:
make distclean
./configure --prefix=/usr/local/apache --enable-rewrite --<any other options you want>
make
sudo make install
 
Old 03-18-2012, 12:01 AM   #5
suj
Member
 
Registered: Dec 2009
Posts: 33

Original Poster
Rep: Reputation: 1
sorry, here is my configure options

./configure --prefix=/usr/local/apache --enable-shared=max --enable-module=rewrite --enable-module=so

======

running the below commands will make any changes to the current settings?

make distclean
./configure --prefix=/usr/local/apache --enable-rewrite --<any other options you want>
make
sudo make install
 
Old 03-18-2012, 05:35 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
sorry, here is my configure options

./configure --prefix=/usr/local/apache --enable-shared=max --enable-module=rewrite --enable-module=so
What version of apache are you trying to compile? The options above are valid for apache-1.3.x. The options I gave you are for apache-2.x
If that's the case, then you can look for the module under /usr/local/apache/libexec.
And you can test mod_rewrite it with:
Code:
RewriteEngine on
RewriteRule ^google.html http://www.google.com
Regards
 
  


Reply

Tags
mod_rewrite


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need some mod rewrite help carters2 Linux - Server 10 04-04-2011 08:47 PM
conf :Mod rewrite,Mod Jkand virtualhosts ayyappansan Linux - Server 1 10-25-2009 04:10 AM
mod rewrite question jamsda Linux - Server 1 10-18-2008 07:31 PM
Apache2 mod vhost_alias - problems with .htaccess mod rewrite d_t_baker Linux - Server 1 08-16-2007 08:32 PM
Mod Rewrite Help carminejg3 Linux - Software 0 12-20-2004 06:19 PM


All times are GMT -5. The time now is 07:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration