Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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]
</IfModule>
# END WordPresss

Any ideas arre greatly appreciated!!

share|improve this question
    
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 :/. –  Maxwell 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. –  Maxwell Oct 6 '13 at 21:23
show 3 more comments

2 Answers 2

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/

share|improve this answer
    
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 –  Maxwell Oct 6 '13 at 22:11
add comment

I was modifying the main query in pre_get_posts...

share|improve this answer
    
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. –  Maxwell Oct 7 '13 at 22:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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