[TYPO3] changing the page uid - how to

Christopher Torgalson bedlamhotel at gmail.com
Thu Mar 15 05:41:55 CET 2007


Hi,

On 3/14/07, David Banning <david at skytracker.ca> wrote:
> Is there a way to change the page uid to a specific number?
>
> I have pages that were indexed by google which I have deleted
> in favour of newly created pages (with new uid's). Google is
> not taking the old pages -out- of their index, (even though all
> they deliver is 404's) and is not adding the -new- pages.
>
> Now exasperated with my clients lost visitors to the site, I would
> like to change the uid of some of the new pages to the uid's
> of the old pages.  Is that possible?
>
> I browsed the "pages" table in phpmyadmin, but


Your problem is not with the page uids, it is with the 404 errors. 404
is the /wrong/ http code to send to any useragent. You should instead
be doing 301 ('Moved Permanently') redirects [1].

On Apache servers, you can add 301s via .htaccess something like this:

# Sample redirect: 301 redirect of index.php?id=105 to index.php?id=104
RewriteCond %{QUERY_STRING} ^id=105
RewriteRule index.php http://%{HTTP_HOST}/index.php?id=104 [R=301,L]

On all other servers, I have no idea :)

Note that the example above does NOT take into account other GET
parameters than '&type=0' (which can safely be dispensed with in most
cases since it's the default). In e.g. tt_news articles etc, the above
will be insufficient. I am currently too tired/caffeine-starved to
figure the rest out. if you need other parameters, you might want to
try the Apache forum at http://www.webmasterworld.com (free
registration required)--it's one of the best places on the web to ask
questions about such stuff.

-- 
Christopher Torgalson
http://www.typo3apprentice.com/


[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html (I don't
know if this is the definitive document or not, but it's a start)


More information about the TYPO3-english mailing list