Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: In .htaccess, how use 301 Redirect in this case? |
|
Author |
|
mplusplus
Joined: 18 Feb 2020 Posts: 1 Location: USA, Fremon
|
Posted: Tue 18 Feb '20 20:44 Post subject: In .htaccess, how use 301 Redirect in this case? |
|
|
Hi there
What line of code in .htaccess will do a 301 redirect from
"/tag/<some-url>.37/"
to
"/category/<some-url>/"
Thereby removing the trailing dot and the number after the dot?
Thanks. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 19 Feb '20 10:11 Post subject: |
|
|
Code: |
RewriteEngine On
Redirect 301 /tag/<some-url>.37/ /category/<some-url>/
|
|
|
Back to top |
|
mraddi
Joined: 27 Jun 2016 Posts: 152 Location: Schömberg, Baden-Württemberg, Germany
|
Posted: Thu 20 Feb '20 22:59 Post subject: |
|
|
A more generic rule might be this:
Code: | RewriteEngine On
RewriteCond %{REQUEST_URI} !^tag/(.*)\.37/
RewriteRule ^tag/(.*)\.37 /category/$1/ [R=302,L] |
|
|
Back to top |
|
|
|
|
|
|