• I performed a default localhost install on Fedora 33, where the default directory is /usr/share/wordpress. I’ve since updated the WordPress Address and Site URL to mysite.com/wordpress, and now I want to get rid of “wordpress” from the URL.

    Everything I read states the most common way to accomplish this is to remove /wordpress from the Site URL, copy the .htaccess and index.php files to the root directory, and update index.php to contain require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' ). The problem is the “root directory” would be /usr/share, a non-wordpress system directory, which doesn’t align with the setups in the tutorials I’ve been reading. Additionally, I can not even locate a .htaccess file, even after “saving changes” on the permalink settings as stated in some guides.

    Since so many things aren’t aligning with what I’ve been reading, I’m assuming I’m off target here–any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dion

    (@diondesigns)

    This really isn’t a WordPress issue, but…the safest way to solve your problem is to edit the Apache virtualhost settings for the localhost domain you’re using. In particular, if DocumentRoot is set to the following:

    DocumentRoot /usr/share/wordpress

    the /wordpress directory will be eliminated from the URL. Another way to resolve the issue is to use the following two commands:

    cd /usr/share
    mv wordpress/* ./

    and once you verify the files weer moved correctly, do rm -rf wordpress to remove the (now-empty) WordPress installation directory. This procedure can be dangerous if there are other files in /usr/share, so if you’re new to Fedora and/or Apache, change DocumentRoot instead. (Restart Apache after making configuration changes.)

    If you are still having trouble, I can tell you what worked for me.
    First, I changed the site url to my base url, so from example.com/wordpress to example.com.
    Then, I moved the index.php file from /usr/share/wordpress to the root dir of the apache website, which on Fedora, defaults to /var/www/html.
    Then, in /etc/httpd/conf/httpd.conf, I changed this:`<IfModule dir_module>
    DirectoryIndex index.html
    </IfModule>`
    To this: `<IfModule dir_module>
    DirectoryIndex index.php
    </IfModule>`, that way it loads the .php instead of a fictional .html
    Then: systemctl restart httpd and it should work. (Maybe, worked for me)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing “/wordpress” from URL on Fedora Install’ is closed to new replies.