Jump to content

mod_rewrite rules file location ?


eekeek

Recommended Posts

I understand mod_rewrite rules can go in the .htaccess file, but where else can you put them? One of the apache2 config files?

 

My setup is a Xubuntu 9.10 apache2 server and I'm pretty sure that 'RewriteMap' does not work in .htaccess.

 

I know I have a lot to learn still, but ultimately I'm trying to achieve case insensitive urls.

Link to comment
Share on other sites

thanks thorpe! Your post pointed me in the right direction. :)

 

I found and used this tutorial to get virtual hosts up and working - http://www.kandar.info/index.php/linux/create-apache-namebase-virtualhost-on-ubuntu

 

I put some rewrite rules in the virtual host file for the appropriate domain under sites-enabled and was able to do a simple redirect.

 

However, then I tried to drop in some code that makes urls case insensitive. After saving the file and upon 'sudo /etc/init.d/apache2 reload' I received a syntax error message that 'RewriteMap not allowed here...Fail!'

 

So, I suppose the obvious question now is if 'RewriteMap' is required for case insensitive urls, where do I put this code?

Link to comment
Share on other sites

Got it! - I know I'm still very ignorant about the ins and outs of apache. Thanks again for your comments thorpe.

 

I moved my code from inside the <Directory> tags to just inside the <VirtualHost> tags and it worked.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.