Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

.htaccess >> ??

Discussion in 'General Discussion' started by mahdionline, Jun 24, 2004.

  1. mahdionline

    mahdionline Well-Known Member

    Joined:
    Oct 18, 2003
    Messages:
    127
    Likes Received:
    0
    Trophy Points:
    166
    Hi
    I have two question :

    1- what is the main work of .htaccess file ?

    2- how i can use (Alias directive in .htaccess?)
    I want to redirect one php file directly to another location of hard!


    Regard
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mahdionline

    mahdionline Well-Known Member

    Joined:
    Oct 18, 2003
    Messages:
    127
    Likes Received:
    0
    Trophy Points:
    166
    Thanks sir,

    but redirect is not a php command. please describe me more!

    Regard
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    Location:
    ON, Canada
    In the .htaccess file you put:

    Redirect old.file new.file

    and anyone going to whatever file name you put first will be sent to the one you put second. That's assuming both files, and the .htaccess file, are in the same directory. If the files are in different directories, it would be:

    Redirect directory1/old.file directory2/new.file
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice