• We have a website whose home page is an application written in a Java. WP makes up the remainder of the site such as How it works, About Us, as well as Blog etc. The home page is just at domain.com and the rest of the pages are at domain.com/folder/page-name. Is there a way to remove /folder/ from the url displayed to users and google in those pages?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You could try adding a .htaccess file to the root with something like this:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
    RewriteCond %{REQUEST_URI} !^/folder/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /folder/$1
    RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
    RewriteRule ^(/)?$ index.jsp [L] 
    </IfModule>
    

    Where domain.com is your domain, folder is the folder where you have WP and index.jsp would be your java homepage file.

    Thread Starter mjefferson96

    (@mjefferson96)

    so if a blog article resides on domain.com/folder/articlename and we were to use this so that the url displays as domain.com/articlename will that have any detrimental impact on SEO quality

    And how would I structure submitted xml sitemaps for that? Without the /folder?

    @dbeja thanks by the way ;o)

    • This reply was modified 7 years, 5 months ago by mjefferson96.

    About SEO, if you already have before the article published with that url (domain.com/folder/articlename), yes, that can have impact on SEO quality.
    Do you have many articles? You probably need to create some 301 redirect rules (with a plugin or on .htaccess) so that old urls don’t have a bad impact on SEO.

    About xml sitemaps yes, they should be without /folder. If you are generating the sitemap automatically, and you have changed site url settings to the new url without /folder, sitemap should be updated automatically.

    Sorry, I don’t have a way to test it right now, so maybe test it first locally with a dummy site.

    Thread Starter mjefferson96

    (@mjefferson96)

    @dbeja It’s a brand new site so nothing will be lost to seo history. There are only 5 current articles and a handful of pages that are all less than 6 months old.

    I prefer to do the sitemap by hand, so thats good to know.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can the url NOT display the subfolder of which WP is installed?’ is closed to new replies.