Permalink Problem
-
I am having trouble setting up permalinks.
I have seen threads on this forum where people have had 404s when trying to open up a permalink page but my problem is a little different.
When I click the permalink, I get a page correctly set out, displaying the date and title, etc of the post just fine, and the comment box underneath, but, rather crucially, the content of the actual post doesn’t show up in between!!
I know this is probably something really basic but I’ve been tearing my hair out. I’ve tried so many different steps to rectify the problem that I can’t even remember them all.
Anyone have any idea as to where I’m going wrong?
I’m using the structure
/index.php/archives/%year%/%monthnum%/%day%/%postname%/
although I’ve tried others, adjusting the .htaccess file accordingly, and the same thing happens each time.
-
Still having trouble. Really at a loose end here, have been all over Google, tried a couple of other forums, no response there either. Not sure what to do.
I’m 99.9% certain my webhosts (who use Apache) allow mod_rewrite, I have tried removing the trailing slash from RewriteBase and all sorts of other suggestions I’ve seen in forums and on the Wiki for this kind of problem (although no-one seems to have had this specific problem).
I’ve even tried ditching smart permalink strctures altogether and just using the default setting with the post ID but the same thing happens even then: When I click the permalink to an entry, I get taken to a page with a blank post, which just has the date and title etc at the top, and the comment box at the bottom but no post in between!
I’m using the structure /archives/%year%/%monthnum%/%day%/%postname%/ and here’s whats in my .htaccess file
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /blog/wp-feed.php?category_name=$1&feed=$2 [QSA]
RewriteRule ^archives/category/?(.*) /blog/index.php?category_name=$1 [QSA]
RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /blog/wp-feed.php?author_name=$1&feed=$2 [QSA]
RewriteRule ^archives/author/?(.*) /blog/index.php?author_name=$1 [QSA]
RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /blog/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /blog/wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /blog/wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /blog/wp-feed.php?feed=$1 [QSA]
RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /blog/wp-feed.php?feed=$1&withcomments=1 [QSA]
</ifmodule>There’s a lot wrong with what you have.
First of all, how do you want to call your blog?
http://www.site.com/archives/2004/09/30/hello-world/
or
http://www.site.com/blog/archives/2004/09/30/hello-world/
Store the .htaccess here:
http://www.site.com/.htaccess
If you’re using the prior URI structure, then put this in the .htaccess:
RewriteBase /
If you’re using the latter, use this instead:
RewriteBase /blog/
Your permalink structure is wrong too. Change this:
/index.php/archives/%year%/%monthnum%/%day%/%postname%/
to this:
/archives/%year%/%monthnum%/%day%/%postname%/
I would say something about your “WordPress” and “Blog” URI settings, but since I don’t know which link structure you’re using, I won’t go any further. It’ll just confuse things.Thanks, I have changed my permalink structure to /archives/%year%/%monthnum%/%day%/%postname%/ as you said.
I want to call my blog using
http://www.site.com/blog/archives/2004/09/30/hello-world/
….so I used RewriteBase /blog/
I did try and store my .htaccess at http://www.site.com/.htaccess like you suggested but the thing is, if I do that I get a 404. It only seems to recognise the .htaccess file if I store it in the /blog directory.
What do I need to do about my “WordPress” and “blog” URI settings?I’ve done all of that.
My WP installation is at http://www.vaguely.org/wordpress.
My blog is at http://www.vaguely.org/blog
My permalink structure is
/archives/%year%/%monthnum%/%day%/%postname%/
My .htaccess file is at vaguely.org/wordpress/.htaccess
The htaccess code it gives me when I click ‘update permalink structure’ is:
RewriteEngine On
RewriteBase /blog/
RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wordpress/wp-feed.php?category_name=$1&feed=$2 [QSA]
RewriteRule ^archives/category/?(.*) /blog/index.php?category_name=$1 [QSA]
RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wordpress/wp-feed.php?author_name=$1&feed=$2 [QSA]
RewriteRule ^archives/author/?(.*) /blog/index.php?author_name=$1 [QSA]
RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /blog/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /wordpress/wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /wordpress/wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wordpress/wp-feed.php?feed=$1 [QSA]
RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wordpress/wp-feed.php?feed=$1&withcomments=1 [QSA]
……which, if I’m not mistaken, looks similar to what I had before. And my permalinks are still not working. 🙁wenchy, move the .htaccess here:
http://www.vaguely.org/.htaccess
and see what happens.
If that didn’t work, move the .htaccess file here:
http://www.vaguely.org/blog/.htaccess
then change this line:
RewriteBase /blog/
to this:
#RewriteBase /blog/I tried all of those and they didn’t work either.
I have left this line set at
#RewriteBase /blog/
and the .htaccess is at
vaguely.org/blog/.htaccesswenchy are you sure mod_rewrite is active/allowed on your server? Or that .htaccess files are allowed to override apache’s default config settings?
This probably doesn’t matter, but make sure the .htaccess is saved in Unix file format and not PC format.
Try the following inside your .htaccess:
<IfModule mod_rewrite.c>
INSERT REWRITE CODE HERE
</IfModule>I’m pretty sure mod_rewrite is allowed on my server as I know of other people who have WP blogs with permalinks hosted on my server.
I have tried using <IfModule mod_rewrite.c> and that just gets me an error 500.
How do I make sure .htaccess is saved in unix and not PC format?I have tried that and it doesn’t work.
I’ve just written to my webhost to double check that mod_rewrite is allowed, and whether .htaccess files are allowed to override apache’s default config settings.
Will post the response.Phew, that was quick!
My webhost says:
Hi
You would not be able to change the settings of the httpd.conf file. However, let us know exactly what you’re looking to edit and we can do it ourselves for your account only.
Thank you
How should I respond to that?Explain your situation to your hosting company regarding your mod rewrite troubles. Ask if .htaccess files have
AllowOverride Allauthority.Thanks. I wrote to my webhost explaining the situation and asking them to give AllowOverride All authority to my htaccess file, and they say they’ve done it.
Permalinks are still not working though. Is there anything else I should do now? Sorry if this sounds dumb but do I need to change my permalink structure and edit my htaccess info again?wenchy, I don’t know what else to tell you. I think it’s time for a moderator/developer to chime in.
wenchy, you may want to review this post:
http://wordpress.org/support/2/13765#post-80988yea, that options symlinks worked for me
The topic ‘Permalink Problem’ is closed to new replies.