• Resolved FeliceAntonio

    (@antonio_09)


    I found this code about remove ‘category’ word in url, is good.

    Instead

    site . com / category / mycat

    or instead

    site . com / category / mycat / mypost . htm

    Now I have

    site . com / mycat

    and

    site . com / mycat / mypost . htm

    Good.

    But when I’m in category_name, if I put some characters before category_name:

    site . com / blabla / myarchive /

    instead return 404, url however working !!!

    Whhat I should do?

Viewing 10 replies - 1 through 10 (of 10 total)
  • But when I’m in category_name, if I put some characters before category_name:

    Do you mean if you use something like:
    /%category%/%postname%/

    Thread Starter FeliceAntonio

    (@antonio_09)

    I use this.

    This url is ok: site . com / mycat

    and I see list posts in category page

    I would know why url work however (watching list post in catagory page) if I call wrong url like this:

    site . com / blabla / mycat

    I don’t get you. Link to a page and explain what you don’t have and what you would like to have.

    Thread Starter FeliceAntonio

    (@antonio_09)

    I would not like to have.

    I seen in several wp blog this joke.

    If you go in a wordpress blog, you could see:

    site . com / category_1

    and you see the list of posts in category_1 and is ok.

    If you write in the url something before category_1

    site . com / something / category_1

    the page work well with wrong url (site . com / something / category_1 isn’t exist), it should return 404 at least, if you have not a way to do redirect 301.

    Thread Starter FeliceAntonio

    (@antonio_09)

    Ops !!! When I wrote

    I would not like to have

    I wrote joking, I mean: I would like to have something less in the url for the reasons up !!!

    Thanks however.

    I’m searching to understand this wp’s aspect.

    Thread Starter FeliceAntonio

    (@antonio_09)

    I tried to add in .htaccess:

    Redirect 301 /(.*)/directory http : // www . example . com / dir

    but doesn’t wotk.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Could you please stop with the spaces in the examples? It makes it harder to read. ??

    That’s a mod_alias example, try using this (untested) mod_rewrite instead.

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule (.*)/directory https://www.example.com/dir [R=301,L]
    </IfModule>
    Thread Starter FeliceAntonio

    (@antonio_09)

    Sorry, doesn’t work, with slash / as first character and without..
    Thanks for the answer.

    Thread Starter FeliceAntonio

    (@antonio_09)

    Sorry,
    I I changed the status resolved on topic because I can’t to work out this problem for me senseless.
    I don’t understand because when I put in category url whatever string before the category name, the result is not 404 (because the url does not exist).

    Where could be the problem ?

    In another my WordPress website this mistake does not happen.

    I’m going crazy…

    Thread Starter FeliceAntonio

    (@antonio_09)

    I tried again after lot of time.
    This Instruction works well.
    I put before the wp code in htaccess.

    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Remove all character before category_name’ is closed to new replies.