I have custom permalinks set up.
But the articles are still accessible through smth like /page/POST_ID or /?p=POST_ID
How can I disable this option (DO NOT redirect, I am interested to have these links DISABLED completely)?
Andrey
I have custom permalinks set up.
But the articles are still accessible through smth like /page/POST_ID or /?p=POST_ID
How can I disable this option (DO NOT redirect, I am interested to have these links DISABLED completely)?
Andrey
Unless you actually link to these somehow, they won't be found except by a snazzy visitor who types them in direct.
Are you trying to remove them for SEO reasons?
I don;t think they can be disabled - they just aren't used.
"Why" is, actually, quite another question.
I might want to have a post, to get access to you have to know its exact permalink, and not just by bypassing via /?p=[1-1024], through search-engine or smth...
I know blogging software which not only makes aliases to the links, but removes the latter, for example serenedipity (CMS). But I would like to have this in wordpress.
p.s. It is like RSS. Developers think you really do not have to disable it, so it is pain to turn it off.
Honest answer: I have a feeling that you're looking at one of those "It's the way that it is" policies that a certain someone feels strongly about and probably won't be changed.
You can try bringing it up on the developer mailing list if you want.
No, tdjcbe, I won't.
I would better do it myself.
Now I change directoryindex and modify rewriterules.. Seem to do what I want. Still experimenting, though.
andmed, let the community know if you have any success when you're done with this :)
No problem %))
in wp-settings.php
after:
require (ABSPATH . WPINC . '/classes.php');
insert smth like:
if ((strpos($_SERVER['REQUEST_URI'], 'p=')) || (strpos($_SERVER['REQUEST_URI'], 'page_id=')) || (strpos($_SERVER['REQUEST_URI'], 'attachment_id='))) {
status_header( 404 );
die('<title>HTTP 404 Not Found</title>404');
}
that's all!!!
ONLY permalinks will work
p.s. of cause, use it at your own risk. no guarantees :)
it means ONLY your, custom permalinks will function
But it also means that you cannot preview posts or pages before they are published.
The preview functionality uses the ?p= address
Might have been better to write a plugin that hooks into the init action and checks the URL at that point before sending a 404 error.
Then you can check if the user is logged in and determine if you want them to be able to view the p= page or not.
About plugin -- if someone wants, not me.
I just have my blog, am not a programmist, really %)
Thank you for the hint about previews. It can be cured easily by adding more checks, I guess.
btw, just checked it up
Previews are not working for me anyway, since I do NOT use javascript in my main browser. :)
This would, probably, be the next thing to do - to make media-upload.php function without javascript. Now it is a problem for me to insert images, and for the most time I just avoid doing this in WP. Apart from that I really do not feel restraints with WP's admin panel when not using javascript. (Do not know about 2.7 though, more javascripts might well be the reason, I will not switch to it)
Finally, I have set it up! Here at http://info.legallyrussia.com/ there are some hidden posts and pages (actually, there ara no public ones). If someone manages to discover them, please, let me know the backdoor.