Category page doesn’t use category.php, instead it redirects to homepage

I am currently modifying a theme. This theme doesn’t had a category.php I needed a custom category page. So, I made one. It works on my local server, but when I uploaded it to a real server, this page doesn’t work. It always redirect to frontpage. It has a front-page.php and other pages include
archive.php,
index.php,
Some custom page template,
single page templates,
taxonomy-custom_cat.php etc.

I mean everything is pretty normal. Everything else works fine, but on the main server category doesn’t work anyway. Isn’t it violating template hierarchy?

Read More

By the way, the main server is wordpress multisite. I had to enable the theme in network admin and then use it in the current site. Thanks in advance.

Edit: I found out something interesting. It redirects to frontpage or uses 404 page in the following condition
No. not all 404 urls redirect to the front page. I am giving you a general idea

www.example.com/category/category-name -> redirects to front page
www.example.com/category/xxxxx         -> redirects to front page
www.example.com/xxxxx                  -> redirects to front page
www.example.com/xxxx/xxxx              -> goes to 404 page

*xxxx means garbage url

It actually use 404 page, but not all the cases and by the way I’m using wpmudev

Related posts

Leave a Reply

3 comments

  1. Check that your category.php file has no errors first.

    Go to Settings -> Permalinks and save it again to rebuild your permalink structure just in case.

  2. It seems your category.php is not uploaded to the proper folder while you upload to your server.
    Once it happened to one of my friend.

    confirm that your files arranged something like this.

    or
    yourblogrootfolder/wp-content/themes/yourblogtheme
    inside this.

    • index.php
    • category.php
    • date.php
    • archive.php
    • author.php
    • style.css
  3. Try checking the file permissions. Many hosts require that the permissions be 644 for PHP files. In particular suPHP will usually block execution of files that even have 664 permissions. New files uploaded via FTP may not always get umasked properly depending on the FTP client and server setup.