We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43567
    • 14 Posts
    Hi all,

    MODx Evolution 1.0.14
    YAMS 1.1.9
    Moving to Apache Webserver

    I am looking to move my site from an IIS hosted web server to Apache and have the a bit of a problem regarding friendly urls. My site is multilingual and the .htaccess file is as follows -

    # Friendly URLs
    RewriteEngine On
    RewriteBase /

    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]

    # Exclude /assets and /manager directories from rewrite rules
    RewriteRule ^(manager|assets) - [L]

    # Redirect from mydomain.com/rootname to mydomain.com/rootname/
    RewriteRule ^en$ en/ [R=301,L]
    RewriteRule ^ie$ ie/ [R=301,L]

    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ie/(.*)$ index.php?q=$1 [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    with the en - english contennt and is - Irish content. All working well on IIS but when I am looking to use the following in the apache httpd-vhosts.conf file as my site is within a folder off the root I get the http 500 Internal Server Error. The httpd-vhosts.conf being as follows:

    <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "c:/wamp/www/mysite.ie"
    ServerName ww1.mysite.ie
    # ServerAlias www.dummy-host.example.com
    ErrorLog "logs/ww1.mysite.ie-error.log"
    CustomLog "logs/ww1.mysite.ie-access.log" common

    # Rewrite Rules #####################
    RewriteEngine On
    RewriteRule ^/mysite.ie/(.*) / [R=301,L]

    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]

    # Exclude /assets and /manager directories from rewrite rules
    RewriteRule ^(manager|assets) - [L]

    # Redirect from mydomain.com/rootname to mydomain.com/rootname/
    RewriteRule ^ie$ ie/ [R=301,L]
    RewriteRule ^en$ en/ [R=301,L]

    # The Friendly URLs part
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
    RewriteRule ^ie(.*)$ index.php?q=$1 [L,QSA]
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
    RewriteRule ^en(.*)$ index.php?q=$1 [L,QSA]
    #RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    #RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
    #RewriteRule ^/(.*)$ /index.php?q=$1 [L,QSA]
    # end Rewrite Rules #################
    </VirtualHost>

    Any ideas? I'm not familiar with this at all. Any pointers would be greatly appreciated!

    Thanks for your patience.
      • 33238
      • 388 Posts
      I have some Yams sites working, so I can give you my .httacces just check it what might be wrong or replace it.

      # For full documentation and other suggested options, please see
      # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
      # including for unexpected logouts in multi-server/cloud environments
      # and especially for the first three commented out rules
      
      #php_flag register_globals Off
      #AddDefaultCharset utf-8
      #php_value date.timezone Europe/Moscow
      
      Options +FollowSymlinks
      RewriteEngine On
      RewriteBase /
      
      # Fix Apache internal dummy connections from breaking [(site_url)] cache
      RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
      RewriteRule .* - [F,L]
      
      # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
      #RewriteCond %{HTTP_HOST} .
      #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
      #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
      
      <ifmodule mod_php5.c>
      php_flag register_globals off
      php_flag display_errors off
      </ifmodule>
      
      # Exclude /assets and /manager directories and images from rewrite rules
      RewriteRule ^(manager|assets)/*$ - [L]
      RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
      
      # Friendly URLs
      RewriteEngine On
      RewriteBase /
      
      # Fix Apache internal dummy connections from breaking [(site_url)] cache
      RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
      RewriteRule .* - [F,L]
      
      # Exclude /assets and /manager directories from rewrite rules
      RewriteRule ^(manager|assets) - [L]
      
      # Redirect from mydomain.com/rootname to mydomain.com/rootname/
      RewriteRule ^es$ es/ [R=301,L]
      
      # The Friendly URLs part
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^es/(.*)$ index.php?q=$1 [L,QSA]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      
      
      # Reduce server overhead by enabling output compression if supported.
      #php_flag zlib.output_compression On
      #php_value zlib.output_compression_level 5
      
        --
        ysanmiguel.com
        • 43567
        • 14 Posts
        Thanks a million for that. Will go to work on it and keep you posted. Much appreciated. Thanks again
          • 33238
          • 388 Posts
          Your welcome. smiley
            --
            ysanmiguel.com