1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Limitations of .htaccess

Discussion in 'White Hat SEO' started by jacobmartin, Oct 24, 2015.

  1. jacobmartin

    jacobmartin Newbie

    Joined:
    Oct 24, 2015
    Messages:
    1
    Likes Received:
    0
    Hello All, I have a query.
    I have 2 lists of URLs.
    1st list is to be redirected (301 redirection) to the 2nd list. (There are more than 1000 URLs in both the list)
    My 1st query: What is the maximum no of URL redirections (301) that can be done in a .htaccess file?
    My 2nd query: How many .htaccess files can I use in a directory, If I have to perform both 2 operations (404 and 301 redirections)?


    Thanks in Advance.
     
  2. sunny_clicks

    sunny_clicks Regular Member

    Joined:
    Jul 25, 2010
    Messages:
    266
    Likes Received:
    24
    Gender:
    Male
    Occupation:
    PPC Account Manager Buckdat Media
    Location:
    The Web
    1: Technically there is no limit to the number of redirects you can do through Htaccess file. However do check if it affects the load time(some hosting providers put artificial limits)
    2: Having just one Htaccess in the root is advisable and you can put in your codes for both redirects.
     
    • Thanks Thanks x 1
  3. davids355

    davids355 Jr. VIP Jr. VIP

    Joined:
    Apr 25, 2011
    Messages:
    10,187
    Likes Received:
    7,834
    Home Page:
    No limit - I had a site once with a good few thousand lines in htaccess and it didnt cause any issues.
    Having said that, there are potentially better ways of doing it - if the old and new urls follow any sort of pattern then you can probably use some regex to do it in less lines.

    I am not an expert on that but you can normally find how to do it on Google.
     
    • Thanks Thanks x 1