Support » Fixing WordPress » Changing WP URL from blog.domain.com to domain.com/blog

  • Hi everyone,

    I am working on a website called bricklist.nl and it’s running on Laravel.

    Now, I wanted to create a blog for the website. I decided to create a subdomain to keep the Laravel directory clean.

    For SEO purposes, someone advised me to move the blog to /blog. My initial idea was just to change the URL, and not move the whole directory of WP.

    I tried some of the methods described at https://codex.wordpress.org/Changing_The_Site_URL, like adding lines to the wp-config file, but to no avail.

    In the WordPress configuration, WordPress-adres (URL) is set at the directory domain and Siteadres (URL) is set at the desired URL

    My problem is I dont know the right approach to fixing this. The blog is still accessible through /blog isn’t working because Laravel is giving me an error page. ((1/1) NotFoundHttpException). I suspect it’s not redirecting to the directory map.

    What are the best practices for doing this? Do I also need to configure Laravel in some way to allow redirecting to (e.g. creating a route in Laravel)? Is it necessary to move the WordPress directory to root/laravel/blog for example? I could use some guidance on which approach for this problem is recommended.

    If this doesn’t belong here and this question is more relevant for Laravel forums, please let me know.

    Many thanks in advance.

    Stefan

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Here’s a question. What happens if you home your WordPress installation in a directory named “blog” inside your htdocs folder. Does Laravel still route over it?

    Hi JointByte, thanks for your reply. What do you mean with ‘htdocs folder’? My root directory currently looks like this:

    – blog (directory of WP)
    – dev
    – etc
    – laravel (main directory of website)
    – logs
    – mail
    – public_ftp
    – ssl
    – staging
    – tmp

    What are the directories listed under laravel?

    app
    bootstrap
    config
    database
    public
    resources
    routes
    storage
    tests
    vendor

    Okay, inside your public directory create a directory called “blog” and install WordPress inside that. You will notice it will route as expected.

    Alright, thanks! Will try this tonight.

    Do you think I will need to configure a route in Laravel?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Changing WP URL from blog.domain.com to domain.com/blog’ is closed to new replies.