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?

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

  • this happened to me once... just a small tip / test is to (first make sure you uploaded category.php) activate a different theme for a second and reactivate your theme again...
    – Sagive
    Dec 13, 2012 at 1:34
  • category.php is uploaded. Tried reactivating, didn't work.
    – sakibmoon
    Dec 13, 2012 at 1:50
  • Can you please post the content of the category.php file here (or on GitHub) for us to debug? Thanks
    – shea
    Dec 13, 2012 at 4:22
  • Also, check if NOBLOGREDIRECT is defined in wp-config.php
    – shea
    Dec 13, 2012 at 4:23
  • 4
    i bet you have tried this but... update permalinks structure pls Feb 25, 2013 at 17:40

3 Answers 3


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.

  • There is no error in the category.php As I have told before it works in my local server. I figured it is a server issue. Maybe the wordpress multisite is broken or something like that. But it's still weird.
    – sakibmoon
    Mar 21, 2013 at 18:50
  • Did you check with the permalinks?
    – Jaypee
    Mar 21, 2013 at 18:53
  • Yes. I did, but didn't work either.
    – sakibmoon
    Mar 21, 2013 at 19:10

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.

  • www.yourdomain.com/blog/wp-content/themes/yourblogtheme inside this.
  • index.php
  • category.php
  • date.php
  • archive.php
  • author.php
  • style.css

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

  • index.php
  • category.php
  • date.php
  • archive.php
  • author.php
  • style.css
  • @Rifaz It was in proper order. Well, you can consider this issue resolved.
    – sakibmoon
    Dec 21, 2013 at 5:59
  • If his category.php didnt exist it would use archive.php, and if that didnt exist it would fallback to index.php. He could not have activated or viewed the theme without an index.php
    – Tom J Nowell
    May 15, 2014 at 23:45

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.