solved Does URL Mapper module allow wildcards?

Elise
Elise
@elise
8 years ago
249 posts
Documentation:
https://www.jamroom.net/the-jamroom-network/documentation/modules/2956/url-mapper

I just switched from Ning and I get a ton of 404.
I'd like to use URL Mapper to forward using this pattern:
/forum/topic/* forward to /community/forum/empath

But it's not working. Are wildcards allowed?

updated by @elise: 12/13/16 02:51:15AM
brian
@brian
8 years ago
10,148 posts
No - wildcards are not allowed. In this case your best bet is to setup a custom mod_rewrite rule in your site's .htaccess file - that will handle it.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Elise
Elise
@elise
8 years ago
249 posts
Ohhhhh wow. I have hundreds of 404 within minutes of being live. I was counting on that module to solve this. I'm sorry but I don't know enough to write modules right now.

is there another way?
brian
@brian
8 years ago
10,148 posts
This does not require a module - it requires a single line addition to the .htaccess file.

I can add it in for you - but they sometimes have a habit of catching MORE than you want, so just to double check - you want:

1) all requests coming to /forum/topic/* (i.e. all topics)
2) forwarded to /community/forum/empath

Let me know if that is correct.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Elise
Elise
@elise
8 years ago
249 posts
Sorry I saw _mod and my brain exploded!

I have a lot of url i need to redirect. I am used to having cpanel for hosting so i have no idea where to find the .htaccess is. Can you advise on how i can reach it? I'll have to google how to setup forwarders. That's something that is done for me in Wordpress.
Elise
Elise
@elise
8 years ago
249 posts
Never mind, I see it. It's invisible of course :)
Thanks for the example in there ;)
updated by @elise: 09/12/16 01:52:59PM
Elise
Elise
@elise
8 years ago
249 posts
Would you consider adding wild cards to the module as a feature reuquest?
brian
@brian
8 years ago
10,148 posts
This guide will show you how to access your site via SFTP:

https://www.jamroom.net/the-jamroom-network/documentation/jamroom-hosting/2552/connecting-to-your-server-using-sftp

Once inside you'll see directories for each domain - inside each directory is a "public_html" directory where your site lives. You'll find the .htaccess file in that directory.

I started to add it in but have backed out - feel free to set that up like you wish.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
8 years ago
10,148 posts
Elise:
Would you consider adding wild cards to the module as a feature reuquest?

Sure - we can check that out - I don't think it would be hard.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Elise
Elise
@elise
8 years ago
249 posts
Do I need to do something to make the .htaccess kick in?
The rule is there but it's not working.
Elise
Elise
@elise
8 years ago
249 posts
brian:
Elise:
Would you consider adding wild cards to the module as a feature request?
Sure - we can check that out - I don't think it would be hard.

THANK YOU!
Elise
Elise
@elise
8 years ago
249 posts
This is the rule that is not working (still researching why):

# Added by brian to redirect all forum requests
RewriteRule ^/forum/topics/.*$ community/forum/empath [R=301,L]

I also tried
RewriteRule ^/forum/topics/.*$ /community/forum/empath [R=301,L]
brian
@brian
8 years ago
10,148 posts
Try this:
RewriteRule ^forum/topics/.*$ /community/forum/empath [R=301,L] 
Let me know if that works.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Elise
Elise
@elise
8 years ago
249 posts
No love..
brian
@brian
8 years ago
10,148 posts
That should work - I will check it out for you.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
8 years ago
10,148 posts
You're all set - note that you'll need to clear your browser cache, since browsers cache the redirect.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Elise
Elise
@elise
8 years ago
249 posts
Sweetness thanks. It must have been the cache. I didn't realize that htaccess was in there.
Elise
Elise
@elise
8 years ago
249 posts
Hey Brian, another advantage of updating URL mapper: I just locked myself out of the forum module, with a redirect rule that use forum/.* (Im ok now).

A module could make sure none of the url overwrite core modules url :)
updated by @elise: 09/13/16 11:57:16AM

Tags