How to redirect with Rewrite rules ?

This is a discussion on How to redirect with Rewrite rules ? within the Apache Web Server forums, part of the Web Server and Related Forums category; I'm running a local apache v2.2.6 with full access. I'm trying to make apache redirect all ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-10-2008
Kim
 
Posts: n/a
Default How to redirect with Rewrite rules ?

I'm running a local apache v2.2.6 with full access.
I'm trying to make apache redirect all non-direct to an index file in
a subfolder of documentroot. Without luck so far.

Currently have done the same but the index is in the root of
documentroot, which works like a charm.
RewriteEngine on
RewriteRule ^(.+)/$ index.php


Because I have multiple projects, then I want to redirect to the index
file of the project.
RewriteEngine on
RewriteRule ^(.+)/$ Project1/index.php

Above code doesnt work. I restarted apache on each try. Any idea what
Im doing wrong ?
  #2 (permalink)  
Old 03-10-2008
Nicolas BOUTHORS
 
Posts: n/a
Default Re: How to redirect with Rewrite rules ?

Kim a écrit :
> Above code doesnt work. I restarted apache on each try. Any idea what
> Im doing wrong ?


No, but adding RewriteLog /tmp/rewrite.log and tracing it might help.


--
Nicolas Bouthors -=- Tel : 06 20 71 62 34 -=- Fax : 01 46 87 21 99
NBi SARL -=- http://nbi.fr -=- nbouthors@nbi.fr
  #3 (permalink)  
Old 03-11-2008
Kim
 
Posts: n/a
Default Re: How to redirect with Rewrite rules ?

On Mar 10, 5:36 pm, Nicolas BOUTHORS <nico...@bouthors.org> wrote:
> Kim a écrit :
>
> > Above code doesnt work. I restarted apache on each try. Any idea what
> > Im doing wrong ?

>
> No, but adding RewriteLog /tmp/rewrite.log and tracing it might help.
>
> --
> Nicolas Bouthors -=- Tel : 06 20 71 62 34 -=- Fax : 01 46 87 21 99
> NBi SARL -=-http://nbi.fr-=- nbouth...@nbi.fr


I keep getting 500 errors when adding rewritelog to .htaccess.
The error.log file reports "RewriteLog not allowed here"
RewriteEngine on
RewriteLog "C:/Apache 2.2/rewritelog.log"
RewriteRule ^(.+)/$ Project1/index.php
 


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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:31 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0