I have a website with the following url rewrite set
RewriteRule ^Cat-(.*)-(.*).html$ section.php?cat_name=$1&cat=$2
I'd like to change the URLs from
I can change the rewrite rule to
RewriteRule ^L1-(.*)-(.*).html$ section.php?cat_name=$1&cat=$2
But is there a way I can redirect any pages listed in search engines so that
Yes, that's a simple replacement redirection. See the sample code in my signature's tutorial.
I did have it. But I have returned a few weeks later to admire my break through and I can find no evidence of the work I did.
What a bad trip!
I think I did something like this but it isn't right.
RewriteRule ^L1-(.)-(.).html$ Cat-$1-$2.html [N,L]
Anybody help me?
Based on your sample characters (lowercase for $1 and digits for $2), I'd use:
RewriteRule ^L1-([a-z]+)-([0-9]+)\\.html$ section.php?cat_name=$1&cat=$2 [L]
When you are in a position to specify the characters used in your links, use them in the mod_rewrite code, too. It may be a small security issue to you but it would make hacking much easier for someone trying to break into your website. Besides, the inappropriate use of the :kaioken: EVERYTHING :kaioken: atom is the first indication that the coder has no idea what he/she is doing (and generally results in looping code).
I appreciate the heads up on the security gap. But $1 is a often a mix of Uppercase and lower case so would that make
As important as the security issue is your suggestion doesn't work for the redirect I need.
For example I need:
to go to
I.E. the 'Cat' in the old domain becomes a 'L1' in the new domain.
Thanks for getting back so promptly
This topic is now closed. New replies are no longer allowed.