How can I use PHP to define my .htaccess settings?

Discussion in 'Apache' started by pcheek, Dec 8, 2009.

  1. #1
    I am building a website that will use mod_rewrite to rewrite URL's to many different domain names. I am wondering how I can use PHP in my .htaccess file to define what these domains are. Any suggestions?
     
    pcheek, Dec 8, 2009 IP
  2. Azkaban

    Azkaban Peon

    Messages:
    537
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    .htaccess does not use PHP

    And you cannot configure mod_rewrite for all domains from one .htaccess file (except that the outbound redirects can point to any other domain)

    .htaccess file for each domain will lie in the root folder for that domain on your server. (addon domains can be controlle by single htacess file, but then, the links would only point to www.YourPrimaryDomain.com/AddonDomainFolder/file.php)
     
    Last edited: Dec 8, 2009
    Azkaban, Dec 8, 2009 IP
  3. aquilax

    aquilax Member

    Messages:
    126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #3
    You can reroute all request to one dispatcher .php script.
     
    aquilax, Dec 9, 2009 IP