This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

SinisaPerovic
SinisaPerovic

What is the best way to have OctobrCMS installed alongside old static website? I need to preserve the old site before the new one, to be made with OctoberCMS, is ready to go live. Should I use "maintenance mode" and redirect to old pages or there is a better way to do that.

Cheers,

Sinisa Perovic

Hybrid
Hybrid

Can you put the new OctoberCMS site on a subdomain while you develop it and then swap it over to replace the old site when you're ready?

I think this is the cleanest way and it avoids problems of mixing old and new files and having to deal with more complex rewrite rules. The only thing you need to be careful of is your URLs and make sure they are relative and don't include the temporary subdomain in them.

Maybe others can suggest better options but that would be my first approach...

Good luck :)

SinisaPerovic
SinisaPerovic

This swapping is making me nervous regarding the final outcome.

Thank you anyway for your time and effort Hybrid.

Daniel81
Daniel81

I just install October to a sub-folder in the root of the domain, then use a redirect in my .htaccess to point the domain to that folder once it's ready to go, no problems

SinisaPerovic
SinisaPerovic

Thank you Daniel81 for your time and effort.

Daniel81
Daniel81

No problem @SinisaPerovic - if you want to use this method, I can post the script I use in my .htaccess for you to use

SinisaPerovic
SinisaPerovic

That would be helpful, thanx @Daniel81. I would like to see how to prevent showing of folder name in the URL.

Daniel81
Daniel81

Place this code in a .htacces file in the root of your domain, and replace the parts in the code to reflect your install location & domain etc:

<IfModule mod_rewrite.c>    

  # ----------------------------------------------
  # .htaccess main domain to subdirectory redirect 
  # Do not change this line. 
  # ----------------------------------------------

  RewriteEngine on

  # -----------------------------------------
  # Change example.com to be your main domain
  # -----------------------------------------

  RewriteCond %{HTTP_HOST} ^(www.)?YOUR_DOMAIN.com$ 

  # ---------------------------------------------------------------------------
  # Change 'subdirectory' to be the directory you will use for your main domain
  # ---------------------------------------------------------------------------

  RewriteCond %{REQUEST_URI} !^/OCTOBER_INSTALL_DIR/

  # ------------------------------------
  # Don't change the following two lines
  # ------------------------------------

  RewriteCond %{REQUEST_FILENAME} !-f 
  RewriteCond %{REQUEST_FILENAME} !-d 

  # ---------------------------------------------------------------------------
  # Change 'subdirectory' to be the directory you will use for your main domain
  # ---------------------------------------------------------------------------

  RewriteRule ^(.*)$ /OCTOBER_INSTALL_DIR/$1 

  # ---------------------------------------------------------------------------
  # Change example.com to be your main domain again. 
  # Change 'subdirectory' to be the directory you will use for your main domain 
  # followed by / then the main file for your site, index.php, index.html, etc
  # ---------------------------------------------------------------------------

  RewriteCond %{HTTP_HOST} ^(www.)?YOUR_DOMAIN.com$ 
  RewriteRule ^(/)?$ OCTOBER_INSTALL_DIR/index.php [L]

</IfModule>

Last updated

SinisaPerovic
SinisaPerovic

You're golden @Daniel81. Thank you so much.

Jacob Alvarez
Jacob Alvarez

@Daniel81 Thanks man! I don't have much experience with Apache and PHP and really enjoy the OctoberCMS, but I was having trouble getting my site live because I had initially installed it to /october so I could try it out alongside a working Wordpress version of it. Your .htaccess file did the trick!

Last updated

pixelounge
pixelounge

Might be a year old thread but fantastic work @Daniel81

rml53478
rml53478

4 years old and still coming in handy. Thanks Dan

1-12 of 12

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.