solved Cpanel Redirects

derrickhand300
@derrickhand300
7 years ago
1,353 posts
Hello-I am trying to use 'redirects" in Cpanel to redirect some URLs on my JR site
Specifically the first one I am trying to redirect is ... /oilfield-store to simply .../store
I have added the information in Cpanel and saved cleared caches and the redirect is not happeniong
at the bottom of the htaccess file I can see its been added..
RewriteRule ^oilfield\-store$ "https\:\/\/www\.roughneckcity\.com\/store" [R=301,L]
are there other steps i need to take to make the redirects work in the JR htaccess file?
Thanks
updated by @derrickhand300: 10/15/17 11:31:21PM
SteveX
SteveX
@ultrajam
7 years ago
2,584 posts
My first thought is to try moving that up in the htaccess file so that it comes before the rules which direct all requests to the router.

I would try inserting your rule in a line right after RewriteEngine On, and you probably need to remove the L from the [R=301,L] part.

Give that a try first and report back here.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
derrickhand300
@derrickhand300
7 years ago
1,353 posts
SteveX:
My first thought is to try moving that up in the htaccess file so that it comes before the rules which direct all requests to the router.

I would try inserting your rule in a line right after RewriteEngine On, and you probably need to remove the L from the [R=301,L] part.

Give that a try first and report back here.

Thanks ultraJam
I have a ton of them to do and was hoping it could all be done somehow in Cpanel without having to edit the file each time myself
I did notice cpanel adds them at the bottom of the htaccess file and was hoping there was a line of code i could add to the htaccess file that would alter the way JR uses the file-something in code that says 'allow these redirects" :)
SteveX
SteveX
@ultrajam
7 years ago
2,584 posts
Have you tried using the jrUrlMapper module rather than doing it through cPanel?
Quote: Map and Redirect non-existent URLs to existing URLs



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
derrickhand300
@derrickhand300
7 years ago
1,353 posts
I actually saw a url redirect module in the marketplace and installed it but so far no luck getting it to work in this manner...
derrickhand300
@derrickhand300
7 years ago
1,353 posts
SteveX:
Have you tried using the jrUrlMapper module rather than doing it through cPanel?
Quote: Map and Redirect non-existent URLs to existing URLs

I will try it now- thanks
derrickhand300
@derrickhand300
7 years ago
1,353 posts
Just tried it- does not seem to work for this either
I have it configed in the screenshot- then ran integrity check and cleared browser cache...still goes to the same link
Capture.JPG.jpg
Capture.JPG.jpg  •  55KB

SteveX
SteveX
@ultrajam
7 years ago
2,584 posts
Assuming you have now removed your redirect from htaccess...

Is /oilfield-store a part of Jamroom or something else? Is it a directory? Is it a file? Is it a jrPage item? Or a Sitebuilder url?
If so, try deleting it (or temporarily renaming it).
The url mapper works for non-existant urls.

Does the url mapper work for you for a different url? Give that a try as well.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
7 years ago
2,584 posts
Just checked, the url /oilfield-store exists.

Try it for a non-existant url, then if that works for you delete your file or destination at /oilfield-store


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
michael
@michael
7 years ago
7,715 posts
Do what @ultrajam said. If you don't want to delete that url, rename its URL at:
SITE BUILDER -> PAGE CONFIG -> PAGE SETTINGS -> PAGE URL

change it to something different then the URL Mapper will kick in.
derrickhand300
@derrickhand300
7 years ago
1,353 posts
SteveX:
Assuming you have now removed your redirect from htaccess...

Is /oilfield-store a part of Jamroom or something else? Is it a directory? Is it a file? Is it a jrPage item? Or a Sitebuilder url?
If so, try deleting it (or temporarily renaming it).
The url mapper works for non-existant urls.

Does the url mapper work for you for a different url? Give that a try as well.

Thats probably going to be an issue-the redirect to /store goes to a sub-folder that contains an install of Opencart-I will likely have to hire someone to edit the htacess file directly with all the URLs..
updated by @derrickhand300: 06/26/17 06:19:50AM
michael
@michael
7 years ago
7,715 posts
just try it ;)
brian
@brian
7 years ago
10,148 posts
The URL Mapper module us what you want to use here - designed to do exactly what you're looking for.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags