php - Dynamic rewrites in htaccess file -


I am working on some realties and redirects in my HTX file. My reason for doing this is that I am developing a new design and layout for an existing website, so I have to be redirected to keep Google ranking etc.

Then the old (existing) URL looks like this:

  /news/internet-shopper-numbers-continue-to-grow-$21378232.htm   

and the new URL will look like this: / industry-news / small-business-website-design / internet-shopkeeper-numbers-continuing / 800715788

Internet-Shopper-number-issued-to-grow is generated dynamically in the old URL, where small-business as the new URL -website-design , internet-shopper-continue the numbers-increments For all, , and 800715788 are all dynamically generated.

So my problem is how do I get from 1 URL to second place, if only 1 dynamic generated variable is available.

I was thinking that it would be a good idea to redirect a PHP instead, where I can get data from the URL. Monstrous through the database to get all the data needed to generate the new URL, but I'm not sure that this is a good practice, this also means that the old URL file will be linked to the directory which is not the current case.

I think I'm guessing starting with something like this:

  option + follow link rewriteEngine RewriteCond / news /% {QUERY_STRING} (.) (.) ???) +) (.) (Htm) $ RewriteRule ^ industry-news /(.+)/% 1 / (\ d {9})   

I know this is very It is basically a bit wrong, but I am working for it.

- Additional questions -

Am I able to do something like that?

  Remit Condom / New /% {QUERY_STRING} (.) (\\ d +). Htm $ RewriteRule ^ industry-new / article / article.php = direct =% 1   

I do not know how to actually go about testing it, but will it work ? Yes, it's definitely a good idea to do all the redirection stuff in Php just a simple " Catch-all ". Htaccess

  Rivet condom% {REQUEST_FILENAME}! -f rewrite code% {REQUEST_FILENAME}! -D Revival. * Index.php   

Then change the URL when you want it in PHP and send location headers if necessary. It may be a good idea to add a 301 status code for the "old" URL.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -