Results 1 to 8 of 8

Thread: No URL suffix

  1. #1
    User
    Join Date
    03-04-10.
    Posts
    52

    Default No URL suffix

    Hello all

    I tried removing .html from the URL suffix setting in Site Settings, but then I just got 404s. Is it possible to publish pages without URL suffixes?

    Thanks

    Tom

  2. #2
    User
    Join Date
    07-01-09.
    Posts
    91

    Default Re: No URL suffix

    You have to make a change to your .htaccess file.

    I have the following:

    Code:
    ##
    # Rewrite base
    ##
    RewriteEngine On
    RewriteBase /
    
    ##
    # Block malicious requests
    ##
    RewriteCond %{REQUEST_URI} (ftp|https?):|/etc/ [NC,OR]
    RewriteCond %{QUERY_STRING} (ftp|https?):|/etc/ [NC]
    RewriteRule .* - [F,L]
    
    ##
    # Compress .js and .css files
    ##
    AddEncoding gzip .gz
    AddType "text/javascript" .gz
    AddType "text/css" .gz
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME} \.(js|css)$
    RewriteCond %{REQUEST_FILENAME}.gz -f
    RewriteRule ^(.*)$ $1.gz [L]
    
    ##
    # Rewrite TYPOlight URLs
    ##
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [L]

    Make a backup of your existing file before you make any changes. Hope this helps.

  3. #3
    User
    Join Date
    03-04-10.
    Posts
    52

    Default Re: No URL suffix

    Great - that works perfectly, together with removing the contents of the URL suffix field in Site Settings.

    Many thanks

    Tom

    PS This is my first experience of Typolight, and I am really liking what I see, compared with Obtree, Livelink, Microsoft CMS, Sharepoint, and Drupal, all of which I have some experience of. I really think it might be the CMS for me, but I'll reserve judgement until I finish my first site.

  4. #4
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: No URL suffix

    You'll love it - we all do! :D

  5. #5
    New user
    Join Date
    08-11-10.
    Posts
    20

    Default Re: No URL suffix

    Has the .htaccess file changed since switching to Contao?

    I have the following. Do you know what I should amend? A bit overcautious amending this section as my first project on Contao is almost finished!

    Thanks again for any advice.

    Code:
    <IfModule mod_deflate.c>
    
      ##
      # Use mod_deflate to compress JavaScript, CSS and XML files. Do not add
      # PHP and HTML files, because those have already been compressed by Contao.
      ##
      <FilesMatch "\.(css|js|xml)$">
        SetOutputFilter DEFLATE
      </FilesMatch>
    
    </IfModule>
    
    <IfModule mod_headers.c>
    
      ##
      # Add a Vary Accept-Encoding header for the compressed resources. If you
      # modify the file types above, make sure to change them here accordingly.
      ##
      <FilesMatch "\.(js|css|xml|gz)$">
        Header append Vary Accept-Encoding
      </FilesMatch>
    
    </IfModule>
    
    <IfModule mod_expires.c>
      ExpiresActive On
    
      ##
      # Specify an expiration one week in the future for images, JavaScripts and
      # CSS files (as recommended by Google Page Speed). Edit or remove the lines
      # to set up your own expiration logic.
      ##
      ExpiresByType image/png A604800
      ExpiresByType image/gif A604800
      ExpiresByType image/jpg A604800
      ExpiresByType image/jpeg A604800
      ExpiresByType text/javascript A604800
      ExpiresByType application/x-javascript A604800
      ExpiresByType text/css A604800
    
    </IfModule>
    
    <IfModule mod_rewrite.c>
      RewriteEngine On
    
      ##
      # Set the RewriteBase if your Contao installation is in a subdirectoy and
      # the rewrite rules are not working properly. Usage examples:
      #
      #   RewriteBase /contao-2.9.0
      #   RewriteBase /path/to/contao
      #
      # Uncomment the following line to set the RewriteBase.
      ##
      #RewriteBase /
    
      ##
      # Contao usually does not pass absolute URLs via GET, therefore the
      # following rules block all requests that try to pass a URL or the /etc/
      # directory as parameter (malicious requests).
      ##
      RewriteCond %{REQUEST_URI} (ftp|https?):|/etc/ [NC,OR]
      RewriteCond %{QUERY_STRING} (ftp|https?):|/etc/ [NC]
      RewriteRule .* - [F,L]
    
      ##
      # Uncomment the following lines and replace "domain.com" with your domain
      # name to redirect requests without "www" to the correct domain. 
      ##
      #RewriteCond %{HTTP_HOST} ^domain\.com [NC]
      #RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    
      ##
      # Do not rewrite requests for static files or folders such as style sheets,
      # images, movies or text documents.
      ##
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
    
      ##
      # By default, Contao adds ".html" to the generated URLs to simulate static
      # HTML documents. If you change the URL suffix in the back end settings, make
      # sure to change it here accordingly!
      #
      #   RewriteRule .*\.html$ index.php [L]   # URL suffix .html
      #   RewriteRule .* index.php [L]          # No URL suffix
      #   RewriteRule .*\.txt$ index.php [L]    # URL suffix .txt
      #
      # If you are using mod_cache, it is recommended to use the RewriteRule below,
      # which adds the query string to the internal URL:
      # 
      #   RewriteRule (.*\.html)$ index.php/$1 [L]
      #
      # Note that not all environments support mod_rewrite and mod_cache!
      ##
      RewriteRule .*\.html$ index.php [L]
    
    </IfModule>

  6. #6
    Experienced user
    Join Date
    06-10-09.
    Location
    Atlanta, Georgia
    Posts
    611

    Default Re: No URL suffix

    Hamilton,

    I believe there have been a lot of changes to the root htaccess in recent versions. Just keep your original file and try modifying .htaccess.default to get it working. It should be as simple as applying the same changes that you did in the previous version.

  7. #7
    New user
    Join Date
    08-11-10.
    Posts
    20

    Default Re: No URL suffix

    Hi Ben,

    Thanks for your reply. What I am unsure of, however, is what to amend in the .htaccess file. Is there a guide on this particular section?

    Agree with what Tom said earlier about how easy this CMS has been to use compared to others.

    Again, thanks for any help.

  8. #8
    Experienced user
    Join Date
    06-10-09.
    Location
    Atlanta, Georgia
    Posts
    611

    Default Re: No URL suffix


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
  •