SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help with .htaccess

    hello, well im not so good in htaccess and need some help.

    I have a site on a location www.mydomain.com/sub/...

    The thing I want is when I goes to www.mydomain.com I want to se my sub page, is it posible and how?

    eks.
    mydomain.com/index.php > mydomain.com/sub/index.php
    mydomain.com/admin/index.php > mydomain.com/sub/admin/index.php

    I need the users and browser to think the are on mydomain.com but the files are located on mydomain.com/sub/

  2. #2
    SitePoint Addict
    Join Date
    Jul 2008
    Location
    sudo rm -rf /
    Posts
    386
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You want to do redirect?

  3. #3
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You use RewriteEngine. If you add the code below to your root .htaccess file and the visitor types in mydomain_com/index_php he will think he visits a file in the root folder, but the physical file that is requested is mydomain_com/sub/index_php.

    Code:
    RewriteEngine On
    
    RewriteRule ^(.*)$ sub/$1 [L]
    Edit: Swapped the dots against underscores because the forum thought I were posting links.
    WebAppMix.com - Creativity and design

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks but I got this error now:

    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.

    ?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •