WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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 SEO Dec 13 '12 at 1:34
category.php is uploaded. Tried reactivating, didn't work. – sakibmoon Dec 13 '12 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 '12 at 4:22
Also, check if NOBLOGREDIRECT is defined in wp-config.php – shea Dec 13 '12 at 4:23
i bet you have tried this but... update permalinks structure pls – user1576978 Feb 25 '13 at 17:40

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.

share|improve this answer
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 '13 at 18:50
Did you check with the permalinks? – Jaypee Mar 21 '13 at 18:53
Yes. I did, but didn't work either. – sakibmoon Mar 21 '13 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
share|improve this answer
@Rifaz It was in proper order. Well, you can consider this issue resolved. – sakibmoon Dec 21 '13 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 '14 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.

share|improve this answer

protected by toscho Sep 26 '14 at 7:42

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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