Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

how to add multiple redirection rule in .htaccess ?

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


joydeep at infoservices

Jun 26, 2012, 10:53 PM

Post #1 of 3 (244 views)
Permalink
how to add multiple redirection rule in .htaccess ?

Dear list,

I already have the following at my .htaccess which is running well

[........]

RewriteCond %{HTTP_HOST} ^mydomain.com [OR]
RewriteCond %{HTTP_HOST} ^www.mydomain.com
RewriteCond %{REQUEST_URI} !folderB/
RewriteRule ^(.*)$ folderB/ [L]

[...........]

I need a little modification like if I give
mydomain.com/folderA then it will go straight
inside folderA otherwise the above will be honored.

Can I write multiple rewrite condition ? I have tried a different
block as above but with folderA added at .htaccess and the apache error log shows

``````````````````
Request exceeded the limit of 10 internal redirects due to probable configuration error.
Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
````````````````

How can I fix this ?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


icicimov at gmail

Jun 27, 2012, 12:26 AM

Post #2 of 3 (234 views)
Permalink
Re: how to add multiple redirection rule in .htaccess ? [In reply to]

RewriteCond %{HTTP_HOST} ^mydomain.com [OR]
RewriteCond %{HTTP_HOST} ^www.mydomain.com
RewriteCond %{REQUEST_URI} !folderB/
RewriteCond %{REQUEST_URI} !folderA/
RewriteRule ^(.*)$ folderB/ [L]


On Wed, Jun 27, 2012 at 3:53 PM, J. Bakshi <joydeep [at] infoservices> wrote:

> Dear list,
>
> I already have the following at my .htaccess which is running well
>
> [........]
>
> RewriteCond %{HTTP_HOST} ^mydomain.com [OR]
> RewriteCond %{HTTP_HOST} ^www.mydomain.com
> RewriteCond %{REQUEST_URI} !folderB/
> RewriteRule ^(.*)$ folderB/ [L]
>
> [...........]
>
> I need a little modification like if I give
> mydomain.com/folderA then it will go straight
> inside folderA otherwise the above will be honored.
>
> Can I write multiple rewrite condition ? I have tried a different
> block as above but with folderA added at .htaccess and the apache error
> log shows
>
> ``````````````````
> Request exceeded the limit of 10 internal redirects due to probable
> configuration error.
> Use 'LimitInternalRecursion' to increase the limit if necessary. Use
> 'LogLevel debug' to get a backtrace.
> ````````````````
>
> How can I fix this ?
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>


joydeep at infoservices

Jun 27, 2012, 2:27 AM

Post #3 of 3 (229 views)
Permalink
Re: how to add multiple redirection rule in .htaccess ? [In reply to]

Many many thanks ....


On Wed, 27 Jun 2012 17:26:56 +1000
Igor Cicimov <icicimov [at] gmail> wrote:

> RewriteCond %{HTTP_HOST} ^mydomain.com [OR]
> RewriteCond %{HTTP_HOST} ^www.mydomain.com
> RewriteCond %{REQUEST_URI} !folderB/
> RewriteCond %{REQUEST_URI} !folderA/
> RewriteRule ^(.*)$ folderB/ [L]
>
>
> On Wed, Jun 27, 2012 at 3:53 PM, J. Bakshi <joydeep [at] infoservices> wrote:
>
> > Dear list,
> >
> > I already have the following at my .htaccess which is running well
> >
> > [........]
> >
> > RewriteCond %{HTTP_HOST} ^mydomain.com [OR]
> > RewriteCond %{HTTP_HOST} ^www.mydomain.com
> > RewriteCond %{REQUEST_URI} !folderB/
> > RewriteRule ^(.*)$ folderB/ [L]
> >
> > [...........]
> >
> > I need a little modification like if I give
> > mydomain.com/folderA then it will go straight
> > inside folderA otherwise the above will be honored.
> >
> > Can I write multiple rewrite condition ? I have tried a different
> > block as above but with folderA added at .htaccess and the apache error
> > log shows
> >
> > ``````````````````
> > Request exceeded the limit of 10 internal redirects due to probable
> > configuration error.
> > Use 'LimitInternalRecursion' to increase the limit if necessary. Use
> > 'LogLevel debug' to get a backtrace.
> > ````````````````
> >
> > How can I fix this ?
> >
> > Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.