Results 1 to 16 of 16

Thread: [solved] Migration error - can't get the redirect to subfolder out of it -

  1. #1
    User
    Join Date
    08-04-09.
    Posts
    230

    Default [solved] Migration error - can't get the redirect to subfolder out of it -

    I am totally baffled.

    Made a site in a subfolder ../site
    Site is finished, I want to migrate to its final destination.

    removed the /site from

    $GLOBALS['TL_CONFIG']['websitePath'] = '';

    Like I did one 100 times before.

    HOWEVER, the site keeps on redirecting to .../site
    There is nothing (as far as I can see in my root page of the site that redirects to subfolder ../site

    What am I doing wrong?
    Last edited by lostrisq; 11/28/2013 at 09:18.

  2. #2
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Just run the Contao install tool! This will set up all the relevant paths automatically. I guess the path in your "pathconfig.php" is still wrong.

    On the other hand, you can also point the respective domain name to the subfolder /site, so you do not need to move the entire installation.
    Contao Community Moderator
    → Support options

  3. #3
    User
    Join Date
    08-04-09.
    Posts
    230

    Default

    Hey Xchs,

    The install tool is not running either!
    it just throws the site in a neverending loop.

    The contao check does work an states the server is fine.

    i could indeed point to ../subdomain

    But i would really like to know what is going on...

  4. #4
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Did you enable the URL rewriting? Then you would have to set in your ".htaccess" the RewriteBase to "/", i.e.
    Code:
    RewriteBase /
    Contao Community Moderator
    → Support options

  5. #5
    New user
    Join Date
    09-19-11.
    Posts
    12

    Default

    Quote Originally Posted by lostrisq View Post
    I am totally baffled.

    Made a site in a subfolder ../site
    Site is finished, I want to migrate to its final destination.

    removed the /site from

    $GLOBALS['TL_CONFIG']['websitePath'] = '';

    Like I did one 100 times before.

    HOWEVER, the site keeps on redirecting to .../site
    There is nothing (as far as I can see in my root page of the site that redirects to subfolder ../site

    What am I doing wrong?
    This has happened to me couple of times. I'm not certain why exactly this happens. Try deleting pathconfig.php. After you've deleted it, run the installer again. The installer should automatically generate it again with the correct setting.

  6. #6
    User
    Join Date
    08-04-09.
    Posts
    230

    Default

    Triskal that exactly did it!

    How odd, it has never happened to me before and I have migrated a lot.

    Thanks heaps!!

    Thanks you xchs for helping out as well!

  7. #7
    New user
    Join Date
    12-22-11.
    Posts
    5

    Default

    I am having a similar problem trying to redirect to my contao installation in a subfolder. I have an .htacces in my root folder, and this redirects the domain to the the contao install properly, but all the sub-pages have the subdirectory in the url. I have tried other variations of these rules with the same result.

    my .htacces in the root folder:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteRule ^(assets|robots\.txt) - [L]

    #Rewrites http://www.yoursite.com/subdir to http://www.yoursite.com/
    RewriteCond %{REQUEST_URI} !^/subfolder
    RewriteRule ^(.*)$ subfolder/$1 [L]


    </IfModule>


    --
    in the contao install directory I have tried a few different setting for the .htacces file. I tried with and without the RewriteBase line commented and with the subdirectory included and without;
    ##
    # Set the RewriteBase if your Contao installation is in a subdirectoy and
    # the rewrite rules are not working properly. Usage examples:
    #
    # RewriteBase /contao-2.9.0
    # RewriteBase /path/to/contao
    #
    # Uncomment the following line to set the RewriteBase.
    ##
    # RewriteBase /

    I have a screen shot of the settings in the backend relating to rewriting urls

    In localconfig.php I set:
    $GLOBALS['TL_CONFIG']['websitePath'] = '';


    I have been struggling with this for a couple days now. I don't understand why this is happening, after following the same process that I have a few times already with other iterations of the site. Any help would be appreciated.

    Here is a link to the live site as well, if it helps get an idea of what I mean:
    http://www.pixlvisn.com


    I also tried deleting, and editing pathconfig.php like xchs suggested, but this gave me another problem. the contao backend did not load the css or other files properly.
    Attached Images Attached Images

  8. #8
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    It would be much easier to map the domain directly to the Contao root folder. Usually, this can be done in the domain administration area of your hoster's admin panel.
    Contao Community Moderator
    → Support options

  9. #9
    New user
    Join Date
    12-22-11.
    Posts
    5

    Default

    Quote Originally Posted by xchs View Post
    It would be much easier to map the domain directly to the Contao root folder. Usually, this can be done in the domain administration area of your hoster's admin panel.
    I looked through the control panel and could not find anything other than a form that creates an .htacces file for me. But this only allowed for one domain to be redirected to another, not a domain to be mapped to a subfolder within that same domain.

    I have asked the host (MediaTemple) but if I am not able to do as you suggested, is there anythign I can do with the .htaccess files?

  10. #10
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Quote Originally Posted by robb.innes View Post
    I looked through the control panel and could not find anything other than a form that creates an .htacces file for me. But this only allowed for one domain to be redirected to another, not a domain to be mapped to a subfolder within that same domain.
    Oh. Okay. What a pity.

    If you have shell access (SSH), you could also try to map the respective domain to the corresponding target folder by creating an appropriate symlink. See the following KB article for further details: https://kb.mediatemple.net/questions...+my+site%3F#gs

    Quote Originally Posted by robb.innes View Post
    I have asked the host (MediaTemple) but if I am not able to do as you suggested, is there anythign I can do with the .htaccess files?
    There's a wiki article (originally in German) that covers this topic. Maybe you understand something in the automatic translation of the website: http://translate.google.de/translate...terverzeichnis
    Contao Community Moderator
    → Support options

  11. #11
    New user
    Join Date
    12-22-11.
    Posts
    5

    Default

    Quote Originally Posted by xchs View Post
    Oh. Okay. What a pity.

    If you have shell access (SSH), you could also try to map the respective domain to the corresponding target folder by creating an appropriate symlink. See the following KB article for further details: https://kb.mediatemple.net/questions...+my+site%3F#gs


    There's a wiki article (originally in German) that covers this topic. Maybe you understand something in the automatic translation of the website: http://translate.google.de/translate...terverzeichnis
    Thank you for the links, I worked through the translated German article, and I was able to follow it. I did not have any luck getting it to work though. I had followed the same basic steps before. With an older version of contao and our old site, this method worked for me. Now it is not

    With symlinks, am I able to direct to a subfolder within a domain? I have set up symlinks across domains before, but I thought creating a it replaces the directory with the link. I am a bit worried to do this and wipe everything. Not that I wouldn't back my files up, I have, but I still want to be careful. Would I create a symlink with code like this in the root folder of my domain:

    ln -s /home/00000/domains/example.com/html/sub html

    were "sub" would be "core-master"


    I looked in the pathconfig.php file and changed the path to "" from "/core-master" and the urls worked, but the contao back-end stopped working. I think there must be some sort of conflicting rule somewhere, but I don't know were to look.

  12. #12
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Quote Originally Posted by robb.innes View Post
    Thank you for the links, I worked through the translated German article, and I was able to follow it. I did not have any luck getting it to work though. I had followed the same basic steps before. With an older version of contao and our old site, this method worked for me. Now it is not
    Huh, seems to be a little bit tricky I have to say that I have never done this before. Like I said, I always set the domain routing setup in the domain configuration.

    Quote Originally Posted by robb.innes View Post
    With symlinks, am I able to direct to a subfolder within a domain? I have set up symlinks across domains before, but I thought creating a it replaces the directory with the link. I am a bit worried to do this and wipe everything. Not that I wouldn't back my files up, I have, but I still want to be careful. Would I create a symlink with code like this in the root folder of my domain:

    ln -s /home/00000/domains/example.com/html/sub html

    were "sub" would be "core-master"
    Frankly, I do not know how Media Temple handles the symbolic links. My web hosting service provider lets me create a symlink (in the document root) that is pointing wherever I want. That way, I am able to create some kind of a pseudo document root.

    For instance, given the document root in "/var/www/virtual/foo/" and the respective Contao installation in the subfolder "/var/www/virtual/foo/html/core-master" I'd do as follows:
    Code:
    $ cd /var/www/virtual/foo/
    $ ln -s html/core-master/ example.com
    Symbolic link:
    Code:
    example.com -> html/core-master/
    So, by opening the domain "example.com" in a web browser I can route all requests straight to the specified directory.

    For this to work, there must be of course a proper rewrite rule in the virtualhost configuration :
    Code:
    # If there is a host-specific pseudo-DocumentRoot, use it instead of the default one
    RewriteCond %{REQUEST_URI} !^/f?cgi-bin/
    RewriteCond /var/www/virtual/foo/%{HTTP_HOST} -d
    RewriteRule (.*) /var/www/virtual/foo/%{HTTP_HOST}$1
    But if you are unsure about this, you better should consider asking your provider on that matter.
    Contao Community Moderator
    → Support options

  13. #13
    New user
    Join Date
    12-22-11.
    Posts
    5

    Default

    Thank you for helping me out with this xchs. I tried the symlinks approach, but I could not get it to work the way I wanted to. I ended up just moving the install to the root. I would prefer to have not done this, but for now it will work.

    At the very least I feel like I learned something from this, so thanks again for your help.

  14. #14
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    You're welcome.
    Contao Community Moderator
    → Support options

  15. #15
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default

    Quote Originally Posted by robb.innes View Post
    I ended up just moving the install to the root. I would prefer to have not done this
    Would you like me to take a look at it?
    Contao Community Moderator
    → Support options

  16. #16
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default I had the same issue on moving Contao 2.11.17

    Quote Originally Posted by Triskal View Post
    This has happened to me couple of times. I'm not certain why exactly this happens. Try deleting pathconfig.php. After you've deleted it, run the installer again. The installer should automatically generate it again with the correct setting.
    I ran into the same issue today. I had checked in the localconfig.php file to ensure that the path to Contao had been removed, and each time I went to the backend Settings to remove the development path to Contao, it kept coming back!

    Thanks for your solution. I downloaded the system/config/pathconfig.php file and edited the following line

    // Relative path to the installation
    return '/~egisasso';

    TO

    return '';

    I don't recall seeing this before, but I'll be upgrading the site shortly and this should clear the issue up going forward.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •