ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Redirect add-on domain to EE url?

September 26, 2011 5:46pm

Subscribe [1]
  • #1 / Sep 26, 2011 5:46pm

    Shellster

    33 posts

    Hi all,

    I have an add-on domain that I’m trying to redirect to an EE-URL (domain.com/template_group/template) but for some reason it seems to be stripping out part of the URL.

    In the .htaccess file for the add-on domain, I have the following:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.domain.com$
    RewriteRule ^/?$ "http\:\/\/www\.seconddomain\.com/proyectos/citymall" [R=301,L]


    but the URL I get forwarded to is:  http://www.seconddomain.com/citymall


    My .htaccess for seconddomain.com contains:

    RewriteEngine On
    
    # Redirect non-www urls to www
    
    RewriteCond %{HTTP_HOST} !^www\.seconddomain\.com
    RewriteRule (.*) <a href="http://www.seconddomain.com/$1">http://www.seconddomain.com/$1</a> [R=301,L] 
    
    #Send Proper 404 Headers
    ErrorDocument 404 /index.php/site/404/
    
    # Simple 404 for missing files
    <FilesMatch "(\.jpe?g|gif|png|bmp)$">
      ErrorDocument 404 /index.php/site/404/
    </FilesMatch>
    
    # Remove index.php from URLs (Include Method)
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond $1 ^(member|site|search|default|quienes_somos|proyectos|carreras|arrendamiento|contacto|directorios_tiendas|eventos_tiendas|localizaciones|mas_propiedades|promociones_tiendas|citas|misc|P[0-9]{2,8}) [NC]
    RewriteRule ^(.*)$ /index.php?/$1 [L]


    Anyone have an idea of why this is happening? I’m still learning the basics of mod_rewrite and regex. Thanks!

     

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases