We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    Does anyone knows how I can set my site the homepage always has a Alias?

    So not www.domain.com but www.domain.com/homepage

    I guess htaccess would be the best way?

    This question has been answered by Jako. See the first response.

    [ed. note: fourroses666 last edited this post 12 years, 8 months ago.]
      Evolution user, I like the back-end speed and simplicity smiley
      • 40092
      • 265 Posts
      I would do it in .htacces, yes.

      Something like this should do the trick:

      ReWriteRule ^www.domain.com $ http://www.domain.nl/homepage [R=301,L]
      
      


        • 9995
        • 1,613 Posts
        Hmm, I get a error when doing that.
        Prolly because of the rule I use to add www.

        RewriteCond %{HTTP_HOST} .
        RewriteCond %{HTTP_HOST} !^www\.site\.nl [NC]
        RewriteRule (.*) http://www.site.nl/$1 [R=301,L]
          Evolution user, I like the back-end speed and simplicity smiley
          • 40092
          • 265 Posts
          Losing the www. prexix in the example i gave does that help? Unable to test right now(my vbox is using port 80, currently), sorry.
            • 9995
            • 1,613 Posts
            didn't help sad
              Evolution user, I like the back-end speed and simplicity smiley
              • 40092
              • 265 Posts
                • 9995
                • 1,613 Posts
                Thanks, getting closer,

                The URL is correct but somehow its getting redirected after redirected I think, browser says so and doesn't show the page.

                RewriteCond %{HTTP_HOST} ^(www\.)?site\.nl [NC]
                RewriteRule ^(.*)$ http://www.site.nl/homepage [R,L]
                
                  Evolution user, I like the back-end speed and simplicity smiley
                  • 40092
                  • 265 Posts
                  Can i see your complete .htaccess ?
                    • 9995
                    • 1,613 Posts
                    This is what I have;

                    Options +FollowSymlinks
                    RewriteEngine On
                    RewriteBase /
                    
                    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
                    RewriteRule .* - [F,L]
                    
                    RewriteCond %{HTTP_HOST} .
                    RewriteCond %{HTTP_HOST} !^www\.xxxbv\.nl [NC]
                    RewriteRule (.*) http://www.xxxbv.nl/$1 [R=301,L]
                    
                    #RewriteCond %{HTTP_HOST} ^(www\.)?xxxbv\.nl [NC]
                    #RewriteRule ^(.*)$ http://www.xxxbv.nl/beveiliging-en-veiligheid [R,L]
                    
                    # Exclude /assets and /manager directories and images from rewrite rules
                    RewriteRule ^(manager|assets)/*$ - [L]
                    RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
                    
                    # For Friendly URLs
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                      Evolution user, I like the back-end speed and simplicity smiley
                    • discuss.answer
                      • 13428 ☆ A M B ☆
                      • 1,031 Posts
                      RewriteCond %{HTTP_HOST} ^(www\.)?xxxbv\.nl [NC]
                      RewriteRule ^(.*)$ http://www.xxxbv.nl/beveiliging-en-veiligheid [R,L]

                      With those lines you would redirect everything with the hostname www.xxxbv.nl to http://www.xxxbv.nl/beveiliging-en-veiligheid. But you only want to redirect the the root with empty request uri.

                      Try that:
                      RewriteCond %{HTTP_HOST} ^(www\.)?xxxbv\.nl [NC]
                      RewriteCond %{REQUEST_URI} "^/$"
                      RewriteRule ^(.*)$ http://www.xxxbv.nl/beveiliging-en-veiligheid [R=301,L]

                      Or shorter:
                      RewriteCond %{HTTP_HOST} ^(www\.)?xxxbv\.nl [NC]
                      RewriteRule ^$ http://www.xxxbv.nl/beveiliging-en-veiligheid [R=301,L]