Grow your CSS skills. Land your dream job.

Redirection with .htaccess

  • # May 29, 2012 at 11:57 am

    So basically I want everything on my domain (schart.net) to be redirected to alpha.schart.net or schart.net/alpha . For example, if I would enter in “schart.net/something” in the urlbar, it would redirect to “alpha.schart.net/something” or “schart.net/alpha/something”.

    Here are a few codes I’ve been using for similar things:

    RedirectMatch 301 ^/alpha/(.*)$ http://alpha.schart.net/$1 #Redirects /alpha to alpha

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.schart.net$ [NC]
    RewriteRule ^(.*)$ http://schart.net/$1 [R=301,L] #removes www.

    What would you use?

    – Thank’s :)!

    # May 29, 2012 at 3:43 pm

    If you have a test site on a different ip and want to keep people, except for yourself, out.



    Order deny,allow
    Deny from all
    allow your.ip.address.here


    ErrorDocument 403 http://www.myrealsite.com

    # May 29, 2012 at 3:44 pm

    @Schmotty – No I just want to redirect everyone that goes to schart.net to alpha.schart.net , for example schart.net/something to alpha.schart.net/something instead

    # May 29, 2012 at 4:49 pm

    Oh, I thought this was a code sharing fest.

    __
    # May 29, 2012 at 9:05 pm

    RewriteCond %{HTTP_HOST} ^(www.)?schart.net$ [NC]
    RewriteRule (.*) http://alpha.schart.net/$1 [L,R=301]
    # May 30, 2012 at 1:39 am

    @Schmotty – Oh, well thank you anyways :)

    @traq – Thank’s!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".