So I created a page called test.mydomain.com/hello and when I try to access it, it gives me a 404 error. I tried switching my permalink structure to default and back to post name to see if this was the error, but it's not. In the page editor, I can see that it's the good permalink and when I click on view page, it still gives me a 404 error. Also my htacess is just the default htaccess:

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

Any ideas arre greatly appreciated!!

  • It is hard to tell where this is going wrong. Is there an otherwise working WordPress installation at test.mydomain.com? – s_ha_dum Oct 6 '13 at 21:14
  • Sorry, I don't understand your question. There is a wordpress intallation at test.mydomain.com/wordpress. The homepage is working as well as the posts, just not the pages :/. – user25893 Oct 6 '13 at 21:17
  • OK. There is a WordPress site here: test.mydomain.com/wordpress. But you are talking about a page here: test.mydomain.com/hello. What is the connection? Is this supposed to be a non-WordPress page? – s_ha_dum Oct 6 '13 at 21:21
  • possible duplicate of Pages 404 in wordpress – Joren Oct 6 '13 at 21:22
  • No it is a wordpress page. I created a page in the wordpress admin and gave it the title hello. The permalink that was given by wordpress to this page is test.mydomain.com/hello. – user25893 Oct 6 '13 at 21:23

Change your current permalink structure to the WordPress Default Permalink structure and then again change it back to your current permalink structure. Hope it will work!

If not then clear your browser cache and use Wp Super Cache plugin to clear WordPress Cache. and then open the URL test.mydomain.com/wordpress/hello/

  • This. OP's problem is that he thinks that he should visit test.mydomain.com/hello/ rather than test.mydomain.com/wordpress/hello/ – user2019515 Oct 6 '13 at 21:51
  • Not really! I can access to every posts like this test.mydomain.com/postname. I wanted to put the wordpress installation in a different folder, but I did that: codex.wordpress.org/Giving_WordPress_Its_Own_Directory – user25893 Oct 6 '13 at 22:11

I was modifying the main query in pre_get_posts...

  • If this is the solution then this question is almost certainly too localized but it would help if you could elaborate on this answer. – s_ha_dum Oct 6 '13 at 23:52
  • I was modifying the main query of all request into some custom post types, so it was never using the page.php template. When I was typing test.mydomain.com/pageName, it was actually searching for test.mydomain.com/customPostType/pageName, which resulted in a 404 error. – user25893 Oct 7 '13 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy