Thanks.
I’ve just started off with the first line that you gave me for node 4 and it doesn’t work. The htaccess file is definitely working, but not this line. All I get is the home page coming up (which I’m not redirecting to) and the old URL remains in the location bar. The only lines previous to this in the .htaccess are:
Options +FollowSymLinks
RewriteEngine On
Not sure why this is, is there a setting I’m missing or is there something that’s required when you’re not using a file name in the url?
Clutching at straws a bit here…why wouldn’t this work?
As you discovered, PHPycho’s attempt to match the query string using a RewriteRule is doomed to failure (RewriteRule will only attempt to match the {REQUEST_URI} string).
Where you are failing is that you’re attempting to match a null string whereas Apache can’t serve that so it’s attempting to match (and failing) the DirectoryIndex in use at the time it’s examining the mod_rewrite code. Try changing your regex to ^(|{DirectoryIndex))$ (REPLACE {DirectoryIndex} with the file name) and see if that doesn’t do the trick.
Thanks for your advice guys, I’m still stuck but I think that’s because I didn’t explain myself at the beginning (not another one I hear you cry!) oops.
DK from reading your post I think I mislead you?? or else I’m not quite catching you
So here we go…I have redesigned a website that previously used something like drupal and I’m now using Joomla (on the same domain), so the old URLs now do not work and I need to permanently redirect them to the correct new pages.
obviously does not do it for you (with or without the blue bit?) and PHPycho was on the right track by inventing a redirect which CAN be done with the node/# of your example. My problem is that node/4 does NOT translate to about/.
Very strange, looks like it must have been my error, although I did make sure I checked and double checked that it wasn’t working etc etc - sorry!
One thing that’s come along now is that on some of these pages I just wanted to force some 404s from OLD urls so that they will drop out of Google’s index, they’re just user log on pages - no equivalent on the new site.
And this works and gives a 404 on the live site, but not on my local WAMP site. That produces a server error for the whole local test site. Same htaccess file uploaded (!) - off the top of your head do you know if there is a server setting on my local installation that might cause this error?