We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34004
    • 125 Posts
    I am developing an intranet on an fresh Ubuntu server which will be accessible from http://play (no .com or any tld at all). I have mod_rewrite enabled according to phpinfo and in /etc/apache2/sites-available/default I have AllowOverride All under the <directory /> tag for DocumentRoot /var/www .

    I have followed the instructions at http://rtfm.modx.com/display/revolution20/Using+Friendly+URLs and my .htaccess looks like:

    # MODX supports Friendly URLs via this .htaccess file. You must serve web
    # pages via Apache with mod_rewrite to use this functionality, and you must
    # change the file name from ht.access to .htaccess.
    #
    # Make sure RewriteBase points to the directory where you installed MODX.
    # E.g., "/modx" if your installation is in a "modx" subdirectory.
    #
    # You may choose to make your URLs non-case-sensitive by adding a NC directive
    # to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
    
    RewriteEngine On
    RewriteBase /
    
    
    
    # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^play/ [NC]
    RewriteRule (.*) http://play/$1 [R=301,L]
    
    #RewriteCond %{HTTP_HOST} .
    #RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
    #RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
    
    
    #
    # or for the opposite domain.com -> www.domain.com use the following
    # DO NOT USE BOTH
    #
    #RewriteCond %{HTTP_HOST} .
    #RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
    #RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]
    
    
    
    # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
    # https://www.domain.com when your cert only allows https://secure.domain.com
    #RewriteCond %{SERVER_PORT} !^443
    #RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]
    
    
    
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    
    
    
    


    however all I get when I visit http://play/products is:

    Not Found
    
    The requested URL /products/ was not found on this server.
    
    Apache/2.2.22 (Ubuntu) Server at play Port 80
    


    Any ideas at all? I am thinking that apache may not be set up correctly... [ed. note: ficklelife last edited this post 13 years, 5 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Could it be that there needs to be a .hosts entry somewhere? It's been a while since I've done server admin, but I would expect that the intranet web server would need a .hosts entry mapping "play" to 127.0.0.1, or something like that.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 10487 MODX Staff
        • 1,535 Posts
        Anything in your apache error logs? It could be that there is another AllowOverride directive overriding the one you've changed.
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com