The Entrepreneur Forum | Financial Freedom | Starting a Business | Motivation | Money | Success

Welcome to the only entrepreneur forum dedicated to building life-changing wealth.

Build a Fastlane business. Earn real financial freedom. Join free.

Join over 80,000 entrepreneurs who have rejected the paradigm of mediocrity and said "NO!" to underpaid jobs, ascetic frugality, and suffocating savings rituals— learn how to build a Fastlane business that pays both freedom and lifestyle affluence.

Free registration at the forum removes this block.

HTACCESS - Code Redirect (Anyone?)

MJ DeMarco

I followed the science; all I found was money.
Staff member
FASTLANE INSIDER
EPIC CONTRIBUTOR
Read Rat-Race Escape!
Read Fastlane!
Read Unscripted!
Summit Attendee
Speedway Pass
User Power
Value/Post Ratio
446%
Jul 23, 2007
38,188
170,398
Utah
Does anyone know how to do code 301 redirects in a HTACCESS file?

I need a universal code that will redirect all the tags to the new link.

The following dead link is an example.

https://www.thefastlaneforum.com/tags/invention.html

redirected to:

https://www.thefastlaneforum.com/community/tags/invention

I searched online and could find all kind of variants (file to file, folder to folder) but not this exact rendition.

HOWEVER, I NEED IT TO WORK FOR ALL THE TAGS -- THERE ARE 1000'S OF THEM.

Anyone here know the code?
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.
Last edited:
  • Thread starter
  • Admin
  • #3

MJ DeMarco

I followed the science; all I found was money.
Staff member
FASTLANE INSIDER
EPIC CONTRIBUTOR
Read Rat-Race Escape!
Read Fastlane!
Read Unscripted!
Summit Attendee
Speedway Pass
User Power
Value/Post Ratio
446%
Jul 23, 2007
38,188
170,398
Utah
  • Thread starter
  • Admin
  • #4

MJ DeMarco

I followed the science; all I found was money.
Staff member
FASTLANE INSIDER
EPIC CONTRIBUTOR
Read Rat-Race Escape!
Read Fastlane!
Read Unscripted!
Summit Attendee
Speedway Pass
User Power
Value/Post Ratio
446%
Jul 23, 2007
38,188
170,398
Utah
You could try this bad boy: http://www.webconfs.com/htaccess-redirect-generator.php

It would give you this: RedirectMatch 301 tags/invention.html(.*) community/tags/invention$1

If it works it should support https as well

Actually the problem isn't redirecting ONE file/tag -- the problem is finding the universal code that does it for ALL TAGS.

There are 1000's of tags. Rewriting every tag into the HTACCESS block is not really feasible, or optimal.

The code would need to be something general that converts all the files in the TAG folder using the link format described above.

My guess is it uses regular expressions -- something I fail at miserably.

REDIRECT

/tags/file.html

to

/community/tags/filename​
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.

Digamma

Gold Contributor
Read Fastlane!
Speedway Pass
User Power
Value/Post Ratio
301%
Nov 13, 2014
826
2,487
Try something like this:
RewriteRule ^tags/(.*).html$ /community/tags/$1 [R=301,NC,L]
I might be getting some character wrong (I haven't fiddled with htaccess files in a while), but that's more or less it. Capture the tag and rewrite to the new url using the captured group.
 
  • Thread starter
  • Admin
  • #6

MJ DeMarco

I followed the science; all I found was money.
Staff member
FASTLANE INSIDER
EPIC CONTRIBUTOR
Read Rat-Race Escape!
Read Fastlane!
Read Unscripted!
Summit Attendee
Speedway Pass
User Power
Value/Post Ratio
446%
Jul 23, 2007
38,188
170,398
Utah
That worked by just adding one more character!

Thanks!
 

MyronGainz

Bronze Contributor
Read Fastlane!
Speedway Pass
User Power
Value/Post Ratio
91%
Dec 26, 2013
410
374
33
Toronto
MJ, do you still host with LiquidWeb? I had to do a similar redirect on a website of mine. I contacted LW support, and one of their technicians literally modified the HTACCESS file for me so I could achieve this.
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.
  • Thread starter
  • Admin
  • #8

MJ DeMarco

I followed the science; all I found was money.
Staff member
FASTLANE INSIDER
EPIC CONTRIBUTOR
Read Rat-Race Escape!
Read Fastlane!
Read Unscripted!
Summit Attendee
Speedway Pass
User Power
Value/Post Ratio
446%
Jul 23, 2007
38,188
170,398
Utah

Post New Topic

Please SEARCH before posting.
Please select the BEST category.

Post new topic

Guest post submissions offered HERE.

Latest Posts

New Topics

Fastlane Insiders

View the forum AD FREE.
Private, unindexed content
Detailed process/execution threads
Ideas needing execution, more!

Join Fastlane Insiders.

Top