logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: In .htaccess, how use 301 Redirect in this case?
Author
mplusplus



Joined: 18 Feb 2020
Posts: 1
Location: USA, Fremon

PostPosted: Tue 18 Feb '20 20:44    Post subject: In .htaccess, how use 301 Redirect in this case? Reply with quote

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

PostPosted: Wed 19 Feb '20 10:11    Post subject: Reply with quote

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

PostPosted: Thu 20 Feb '20 22:59    Post subject: Reply with quote

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


Reply to topic   Topic: In .htaccess, how use 301 Redirect in this case? View previous topic :: View next topic
Post new topic   Forum Index -> Apache