[TYPO3] RealURL and .htaccess
Oliver Rowlands
oliver at liquidlight.co.uk
Thu Aug 2 16:16:54 CEST 2007
Hi Alexander,
You can not target the query string with Apache's mod_alias Redirect and
RedirectMatch directives.
You will have to use mod_rewrite instead:
RewriteCond %{QUERY_STRING} nodeID=2357 [NC]
RewriteRule ^productsIndList\.aspx$ http://domain.com/page.html?
[NC,R=301,L]
A few explanations:
- The NC flag means the match is case insensitive;
- The R=301 flag forces a permanent redirect (HTTP 1/x 301 Moved
permanently) which is important if you care about your SEO;
- The L flag stops the rewriting process without applying any other rules;
- The '?' at the end of the redirection URI prevents mod_rewrite from
automatically appending the GET parameters from the old URI.
If you need to redirect more than just a few URIs you might want to
consider using a redirect map instead. I wrote this HOWTO a few of
months ago which explains the process:
http://lists.netfielders.de/pipermail/typo3-english/2007-May/039509.html
BTW: Jan, the [L] flag only applies to mod_rewrite directives not mod_alias.
Hope this helps,
Oliver
Alexander wrote:
> Hello list.
> I have some problems with RealURL configuration and redirections. I need
> place some redirects into my .htaccess file, but now RealURL has
> priority. How can I do this, I mean how to make priority for .htaccess.
> I need to read .htaccess settings first then RealURL settings.
>
> Regards, Alex
--
Oliver Rowlands
:: Liquid Light ::
E - oliver at liquidlight.co.uk
W - http://www.liquidlight.co.uk
T - 00 44 (0)845 6 58 88 35
F - 00 44 (0)845 6 58 44 35
More information about the TYPO3-english
mailing list