Change C5.7 URL for site

Permalink
I think I've made a rookie mistake. I initially installed and built my site in a subfolder of my domain like shown below.

51staerosquadron.org/51as

After reading this link

https://www.concrete5.org/documentation/how-tos/developers/organise-...

I wanted to try to fix my site and begin using test.51staerosquadron.org. In my hosting plan, I went in and created the test.51staerosquadron.org subdomain and pointed it to the /51as directory.

Before attempting to access the site with the new URL, I cleared the cache, then logged out.

I then attempted to access the site by using test.51staerosquadron.org, the home page loads correctly for the most part, but none of the navigation links work. Parts of the pages show up but nothing works...including logging in. When reviewing the page source for several of the pages, most all of the URLs are still trying to access the /51as folder. But the /51as folder is the root folder for the test.51staerosquadron.org subdomain.

Is there a relatively easy way to fix this? I attempted to enter the canonical URL under the URLs and SEO sections...that did not go well. I was then unable to get back into my original URL until I managed to find the SEO section in the /51as/application/config/generated_overrides/concrete.php file and remove the SEO section that had the test.51staerosquadron.org URL.

I'm now able to access my site again at the original URL but would like to change it. If someone could please point me in the right direction, I'd greatly appreciate it.

Thanks

 
mesuva replied on at Permalink Reply
mesuva
When you move a concrete5 install to a different folder, if you also have pretty URLs on the .htaccess file needs to be updated as well.

Have a look at that file and check the line:
RewriteBase /

You might find it's still got:
RewriteBase /51as

If you aren't running it in a folder, it should just look like the former and should be manually changed back.
cnd4ua replied on at Permalink Reply
I didn't check the box for Pretty URLs and I don't have a .htaccess file that I see. Do I need to enable pretty URLs? From what it says, it appear that doing that just removes index.php from the URLs.
mesuva replied on at Permalink Reply
mesuva
You don't have to enable them for things to work.
I may have missed what problem you are trying to solve - are you saying you want to move it again, or you are still not able to access pages?
cnd4ua replied on at Permalink Reply
I'm not physically moving any files...just changing the base URL. I used (and am still using) the following URL to install/develop:

51staerosquadron.org/51as

but want to use

test.51staerosquadron.org

instead. The physical files aren't moving, but the test.51staerosquadron.org subdomain points to the folder above (/51as). So the contents of /51as are now the root for test.51staerosquadron.org.

However, when I access test.51staerosquadron.org, the home page loads, but none of the links from the nav menu works. All of the URLs on the pages are still trying to go to /51as/index.php/<my pages> instead of /index.php<my pages>

Does that help explain it any better?

Thanks!
cnd4ua replied on at Permalink Reply
Here is a little more information...after further troubleshooting, maybe I do need a .htaccess file. Here is the directory structure according to how PHP sees it...

51staerosquadron.org = /home/content/<some numbers>/html (which is redirected via a meta tag to a website builder site that I'm trying to move away from once the C5 site is ready)

so
51staerosquadron.org/51as = /home/content/<some numbers>/html/51as

and then I created a subdomain that maps to the same physical files as above.

test.51staerosquadron.org/ = /home/content/<some numbers>/html/51as

If I do need a .htaccess file, can you provide an example if you can?

Thanks!
mesuva replied on at Permalink Reply
mesuva
Looking at test.51staerosquadron.org it seems links on the nav are pointing to the right paths, it's just that you're losing your stylesheets due to those paths being wrong.

Have you got caching on? Perhaps while you are developing, turn it completely off, otherwise it may cache the page output one way, and then it's only going to work via one path.

It sounds like you've got pretty urls off though (as you've got index.php in the page paths), so once you've sorted out this problem you can just turn them on via the dashboard - I wouldn't do that though until you're not accessing it via two different urls.
cnd4ua replied on at Permalink Reply
I've turned off all caching and cleared the cache.

When I go to test.51staeroaquadron.org the home page works, however when I click on "About" in the nav bar (http://test.51staerosquadron.org/index.php/about), I get to a page, but as you said, the stylesheets are wrong, and there's also an area that says 404 Error.

When I view page source, most all of the links in the About page still include the subfolder name of /51as as follows:

<a href="http://test.51staerosquadron.org/51as/index.php/about" target="_self" class="">About</a>


but it should be (without the /51as):

<a href="http://test.51staerosquadron.org/index.php/about" target="_self" class="">About</a>


I need to figure out how to remove the /51as from all of the links. How can I do that? A .htaccess file?