WordPress.org

Ready to get started?Download WordPress

Forums

Permalink custom structure: how to get rid of path to blog string? (5 posts)

  1. robin_wp
    Member
    Posted 4 years ago #

    (Before I finished this post, I found a potential solution which I note at the end but am not confident I have understood what the options are.)

    I was using the following structure: http://example.com/site_wc/blog_wp1/archives/123.

    I am trying to change the permalink structure to /%category%/%postname%.html with a string in front of that, "Tech/151-200", so that the end result is http://example.com/Tech/151-200/151_metadata/filename.html where "151_metadata" is the category.

    I started with the custom structure as "/%category%/%postname%.html" and used the Category base to specify "Tech/151-200" but that failed.

    Then I tried "/Tech/151-200/%category%/%postname%.html". That produced http://example.com/site_wc/blog_wp1/Tech/151-200/151_metadata/filename.html where "site_wc" is the parent folder for the blog's folder, "blog_wp1" (i.e., the path from public_html to the blog folder).

    How do I get rid of the unwanted part, "/site_wc/blog_wp1" (without moving the blog folder itself)?

    The Category base works when I specify only <Q>Tech</Q> but with the unwanted string "/site_wc/blog_wp1".

    The AskApache RewriteRules Viewer reports permalink_structure is "/Tech/151-200/%category%/%postname%.html"; front is "/Tech/151-200/"; and mod_rewrite_rules includes "RewriteBase /site_wc/blog_wp1/".

    Is the solution the one offered in http://wordpress.org/support/topic/246738?replies=12#post-1329912; namely, in .htaccess , change "RewriteBase /"
    to
    "RewriteBase /blog/" and "/index.php" to "index.php"?

    Any suggestions?

  2. robin_wp
    Member
    Posted 4 years ago #

    Addendum:

    My htaccess consists of the following:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /site_wc/blog_wp1/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /site_wc/blog_wp1/index.php [L]
    </IfModule>

    # END WordPress

    What change (if any) would I make to the line RewriteRule . /site_wc/blog_wp1/index.php [L]?

  3. askapache
    Member
    Posted 4 years ago #

    #BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /site_wc/blog_wp1/index.php [L]
    </IfModule>
    # END WordPress
  4. robin_wp
    Member
    Posted 4 years ago #

    I changed the one line of code as recommended by AskApache but without effect.

    I found that the changed line had reverted back to the original; i.e., RewriteBase /site_wc/blog_wp1/. I repeated the replacement of the file and got the same result again. The AskApache plugin reported the line was unchanged.

    Something is overwriting the changed line.

    The permalink for a test page was unchanged: http://example.com/site_wc/blog_wp1/Tech/151-200/151-200/199_tmp/test.html

    I haven't changed the following two General Settings page settings and I would think that they are relevant:

    WordPress address (URL): http://example.com/site_wc/blog_wp1

    Blog address (URL): http://example.com/site_wc/blog_wp1

    So I still haven't gotten rid of the site_wc/blog_wp1 strings?

    Ideas?

  5. wiserbit
    Member
    Posted 3 years ago #

    You can use this plugin:
    http://wordpress.org/extend/plugins/html-on-pages/

    Then go to the 'Permalink' and set the 'Custom Structure' to the HTML file name you want.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags