php - Add current year in redirect htaccess -


i try write rewrite rule route from:

/abteilungen/einsatzabteilung/einsaetze.php 

to

domain.de/abteilungen/einsatzabteilung/einsaetze/2016 (current_year) 

my .htaccess looks this:

rewriteengine on redirect 301 /abteilungen/einsatzabteilung/einsaetze.php %{http_host}/abteilungen/einsatzabteilung/einsaetze/ 

is possible year @ end of target current year , how can this?

edit

full .htaccess throws 404 error:

rewriteengine on rewriterule ^/abteilungen/einsatzabteilung/einsaetze.php$ %{http_host}/abteilungen/einsatzabteilung/einsaetze/%{time_year} [l,r=301]  rewriterule ^(.*)einsaetze/([0-9]{4})$ $1/abteilungen/einsatzabteilung/index\.php/$2 

in apache exist variable time_year

rewriteengine on redirect 301 /abteilungen/einsatzabteilung/einsaetze.php %{http_host}/abteilungen/einsatzabteilung/einsaetze/%{time_year} 

try use rewriterule

rewriteengine on rewriterule ^/abteilungen/einsatzabteilung/einsaetze.php$ %{http_host}/abteilungen/einsatzabteilung/einsaetze/%{time_year} [r=301,l] 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -