Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    1

    Default Redirect a file to a directory gives a loop?

    Hello,

    I pretend to redirect:

    http://asite.com/directory
    or
    http://www.asite.com/directory

    to

    http://asite.com/directory/index.php
    or
    http://www.asite.com/directory/index.php

    so that visitors only have to type
    http://asite.com/directory/
    or
    http://www.asite.com/directory/

    and be redirected to

    http://asite.com/directory/index.php
    or
    http://www.asite.com/directory/index.php

    I'm using .htaccess inside /directory/ and i have tried this:

    RewriteCond %{HTTP_HOST} ^asite.com/directory$ [OR]
    RewriteCond %{HTTP_HOST} ^www.asite.comt/directory$
    RewriteRule ^compras/indice.php$ "http\:\/\/www\.a site\.com\/directory\" [R=301,L]
    (gives a loop)
    and this:
    redirect /directory /directory/index.php
    (gives a loop)

    Your precious help would be much appreciated I'ts urgent..
    Tank you very much for your atention.

  2. #2
    Member
    Join Date
    Aug 2009
    Location
    Houston, Tx
    Posts
    275

    Default Loop

    Hello,


    If this is urgent please submit a ticket so we can look at it immediately, and in this case we would need to get more info already anyways. Please submit a ticket via the link below. Hopefully we can get it resolved for quickly.

    Thank you,
    Matthew Curry

  3. #3
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,166
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb

    There have been several threads recently about a redirect loop problem, here's one of them. Redirect Loop

    That said, I'm not sure why you're wanting to create a redirect to something that your server should already be able to handle.

    This:

    http://asite.com/directory
    or
    http://www.asite.com/directory

    Should already open to this:

    http://asite.com/directory/index.php
    or
    http://www.asite.com/directory/index.php

    Or this:

    http://asite.com/directory/index.html
    or
    http://www.asite.com/directory/index.html

    ...normally, without a redirect.

  4. #4
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default

    I agree with Infopro on that. However, if you have multiple index files in that directory then you can just put the following entry in the htaccess file in that directory :

    Code:
    DirectoryIndex index.php index.html

  5. #5
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Lightbulb

    Uhm, to the original poster --- very lousy example!

    For everything you posted, you don't need any redirects whatsoever !!!!

    You don't need to setup anything !!!

    Those already are the addresses of everything you typed by default!

    When you don't specify a filename on a URL, the index files are automatically
    displayed when included by default "index.php" which is precisely what you
    used in every single one of your examples.

    Thus, all of the following are the same:

    http://domain.com/folder
    http://www.domain.com/folder
    http://domain.com/folder/
    http://www.domain.com/folder/
    http://domain.com/folder/index.php
    http://www.domain.com/folder/index.php

  6. #6
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,166
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb

    Easy does it, it was posted in the new users section of the forums.

Similar Threads & Tags
Similar threads

  1. cPanel redirect tool is errant - redirect loop error
    By jols in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-19-2009, 03:05 PM
  2. Redirect Loop
    By ahmadsuzairi in forum New User Questions
    Replies: 16
    Last Post: 07-19-2009, 10:51 AM
  3. redirect loop issue
    By Uilmuteiz in forum New User Questions
    Replies: 5
    Last Post: 07-07-2009, 02:17 PM
  4. Redirect Loop
    By neumannu47 in forum New User Questions
    Replies: 2
    Last Post: 03-28-2009, 08:24 AM
  5. Redirect Loop
    By nineseven in forum Database Discussions
    Replies: 3
    Last Post: 11-26-2008, 08:46 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube