htaccess redirect problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I've just tried to add a simple redirect in my htaccess:

Redirect / /

But it does a recursive (somehow) redirect ... after a few seconds,
the URL in my browser changes to /


Re: htaccess redirect problem

dieter mueller wrote:

Quoted text here. Click to load it

Because it will also redirect anything after the / to the new location,
meaning that it will, in this case, go through an infinite loop.

Try this instead:

Redirect /index.html /

That way, you'll only redirect requests for the index file at the
document root level instead of the entire directory tree.

Kim André Akerĝ
(remove NOSPAM to contact me directly)

Re: htaccess redirect problem

And lo, dieter mueller didst speak in alt.www.webmaster:

Quoted text here. Click to load it

You've just told your server to redirect *everything* - including - to /

It's not hard to understand if you consider that the path of starts with / just like /

If all you want to do redirect users landing at to all you need to do is get a bit more specific:

RedirectMatch ^/$ /blog/

This will redirect a path of / (and *only* /) to the blog directory.  One  
of the bonus features of the RedirectMatch directive is that it lets you  
specify target URIs relative to the current domain[1].


[1] Or the assigned server name if UseCanonicalName is set to On in your  

The technical axiom that nothing is impossible sinisterly implies the  
pitfall corollary that nothing is ridiculous.
- - Orca Search: Full-featured  
spider and site-search engine

Re: htaccess redirect problem

Quoted text here. Click to load it

Grazie mille!

Re: htaccess redirect problem

Quoted text here. Click to load it
Hmmm, I think you will find that it should read, redirect 301
I hope that helps a bit.

Regards Chad.

Site Timeline