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.

.htaccess and Template Access settings

May 09, 2012 2:09pm

Subscribe [2]
  • #1 / May 09, 2012 2:09pm

    rblitadmin

    7 posts

    I’ve been trying to get a subdomain to resolve to a subdirectory.  i.e., ‘foobar.mydomain.net’ resolves to ‘mydomain.net/foobar.mydomain.net’.  I’m using the following mod_rewrite rule:

    RewriteCond %{HTTP_HOST} ^foobar.mydomain.net [NC]
    RewriteCond %{REQUEST_FILENAME} !foobar.mydomain.net/
    RewriteRule ^(.*)$ /foobar.mydomain.net/$1 [L]

    This correctly rewrites my request.  However, upon landing at the page, I am repeatedly presented with our ‘Access Denied’ page, no matter how many times I log in correctly.  I know it’s landing at the correct page because when I change the access settings on the landing template, the change is reflected in ‘foobar.mydomain.net’s behavior.

    mydomain.net/foobar.mydomain.net/index.php is a clone of mydomain.net/index.php, with all applicable path settings updated, and appropriate template group, template, and homepage_entry_id values assigned.  Navigating directly to mydomain.net/foobar.mydomain.net behaves correctly, it’s just this redirection that has ExpressionEngine confused.  Any help would be appreciated.

  • #2 / May 10, 2012 1:38pm

    Shane Eckert

    7174 posts

    Hello rblitadmin,

    I am sorry to hear you are running into this problem.

    We currently only support one .htaccess configuration.

    <IfModule mod_rewrite.c>
          RewriteEngine On

          # Removes index.php
          RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ /index.php/$1 [L]

          # If 404s, “No Input File” or every URL returns the same thing
          # make it /index.php?/$1 above (add the question mark)
    </IfModule>

    That 500 error is a clue, that’s the server being angry. There will be clues in the system logs. That would be a great place to start.

    If you would like, I can move this thread to the Community Help Forum. I know some people run with highly modified, some of them may be able to help you tweak that htaccess file.

    Please let me know your thoughts!

    Cheers,

  • #3 / May 10, 2012 1:45pm

    rblitadmin

    7 posts

    That would be helpful, I’d appreciate it if you’d move it to the Community Help Forum.  Thanks for your help.

  • #4 / May 10, 2012 1:46pm

    Shane Eckert

    7174 posts

    Hello rblitadmin,

    I will do that. Sorry I could not be of more help.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases