Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

.htaccess to redirect domain.tld/subdomain to subdomain.domain.tld

Discussion in 'General Discussion' started by andreseso, Jan 25, 2006.

  1. andreseso

    andreseso Member

    May 20, 2003
    Likes Received:
    Trophy Points:

    Using Cpanel I have set up the subdomain at directory

    I want all traffic directed to to be directed to http://alejandro.domain.tld/url

    I have tried with the following .htaccess file in the public_html directory
    RewriteEngine ON
    RewriteCond  %{HTTP_HOST} ^
    RewriteCond %{REQUEST_URI} alejandro
    RewriteRule /alejandro/(.*)$1  [R=301,L]
    RewriteCond  %{HTTP_HOST} ^
    RewriteCond %{REQUEST_URI} alejandro
    RewriteRule /alejandro/(.*)$1 [R=301,L]
    It redirects OK but the URL shown is and I get the following 404 error:

    The requested URL //home/user/public_html/alejandro was not found on this server.

    This is done for Search Engine Optimization.

    Anybody know enogh mod_rewrite to make this work?

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice