Home Forums Weaver Xtreme Theme Does anyone know how I can tell my WordPress site to “alias” its domain name?

  • This topic has 5 replies, 2 voices, and was last updated 1 month ago by LMur.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #69017
    LMur
    Participant

    Hi, folks,

    My WordPress is installed (accidentally) in a sub-folder called https://www.bytesmart.ca/wp.

    When anyone uses the https://www.bytesmart.ca/ URL, the home page works, but then after they go to any of the menu items, the page address always shows in the url bar as https://www.bytesmart.ca/wp/%5Bpage_name%5D.

    Does anyone know of a way I can temporarily tell my wordpress installation to make those addresses appear without the sub-directory name?

    If I go and tell WordPress under the General Settings->Site Address (URL) to use just the top level folder, it generates errors in my web site on the menus.

    I am looking to eventually be able to move the installation to the top level of the folder structure, but that is going to take a week or two due to the frenetic current pace of my business life.

    This isn’t a mission-critical issue, it just offends my aesthetics to look at it, and bugs me.

    So any suggestions that anyone can provide for doing that effectively will be really helpful in letting me sleep nights and move ahead de-stressed!

    Thank you!

     

    Leah Murray

    #69018
    scrambler
    Moderator

    I have a site that is in a subdirectory, and a while back, I had found some code to place in the htaccess file to do that, and not display the subfolder.
    This is not my area of expertise so I do not understand that code, but it has been doing the job fine for years

    When I open my htaccess I see the following code I believe is what does the trick

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?sitename\.com$
    RewriteCond %{REQUEST_URI} !^/subdirectory/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /subdirectory/$1 [L]
    RewriteCond %{HTTP_HOST} ^(www\.)?sitename\.com$
    RewriteRule ^$ /subdirectory/ [L]

    So by extrapolation I would think the code below would do what you want for your site.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?bytesmart\.ca$
    RewriteCond %{REQUEST_URI} !^/wp/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /wp/$1 [L]
    RewriteCond %{HTTP_HOST} ^(www\.)?bytesmart\.ca$
    RewriteRule ^$ /wp/ [L]

    But do that at your own risk, and before doing that, make a copy of your htaccess file with an “old” suffix, so you can easily revert to the original one if it breaks something.

    #69019
    LMur
    Participant

    Thank you, scrambler — I will try that and see if it will work!

    Leah M.

     

    #69020
    LMur
    Participant

    Well, it didn’t like that at all.  Won’t load at all with the code listed in place, so I guess I’m out of luck with that possible solution.

     

    I may have to carve out a few days and just rebuild the whole site.  <sigh>

     

    Any other ideas still welcome!

     

    Leah M

    #69021
    scrambler
    Moderator

    Strange, it is working for me, if you tripled check syntax, not sure why.

    You can use the Step(0) in the article below to clone your site to the root location, then delete the other one

    Converting a Weaver II (Pro) or Aspen site to Weaver Xtreme – Weaver Xtreme Guide (weavertheme.com)

     

    #69023
    LMur
    Participant

    Ok, I’m going to carve out a couple or three hours over the weekend to try out the cloning:  if that works well, it will save me a ton of time and grief!

    Will let you know how it went once it’s done!

     

    Thank you — you folks are awesome!

     

    Leah M

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.