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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.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