How do I redirect the URL for one of my pages to a SEF URL? Topic is solved

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.x extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
rmarcant
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Jan 19, 2010 6:48 pm

How do I redirect the URL for one of my pages to a SEF URL?

Post by rmarcant » Sat Jul 25, 2020 5:00 pm

I've been trying to update my .htaccess file to force a redirect because of the issue with the page the site redirects to when your login expires and you click a member/registered only page without logging in first.

The page that comes up is this (which is my gantry 5 start page I have set to make the whole page one link).
https://gofishcity.com/component/users/ ... Itemid=696

I just want this action to redirect to /login so users who do get logged out can log back in.
https://gofishcity.com/login

Can someone help with the .htaccess code that will work? I've tried several and some take me to 404 page and some blocks the page. I tried this page for help, but no luck...
https://help.dreamhost.com/hc/en-us/art ... cess-file-

Thanks for any help you can provide.
Last edited by imanickam on Sun Jul 26, 2020 2:52 am, edited 1 time in total.
Reason: Changed the Subject from "htaccess URL redirect" to reflect the question. Also, moved the topic from the forum General Questions/New to Joomla! 3.x to the forum Search Engine Optimization (Joomla! SEO) in Joomla! 3.x

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: How do I redirect the "you must login" page/form to another URL I have created for logging in?

Post by sozzled » Sat Jul 25, 2020 7:50 pm

Hmmmm ... this is kind of a SEF URL issue but it's also like trying to develop an armory for a once-in-a-thousand event.

The first problem starts with
rmarcant wrote: Sat Jul 25, 2020 5:00 pm ... the issue with the page the site redirects to when your login expires [after clicking] a member/registered only page
... and before we address what can be done after that, the first question is "How long is the time before the login expires?"

I could understand that there may be a problem if the session length is set to 5 minutes and the session expires really quickly and the user is required to login again (and over and over and over again). On the other hand, what if the session length is set to one hour? How often, after that, is a person likely to navigate to another area that is accessible only to registered members and then they see a page with an odd-looking URL that has "Itemid=696" at the end of it? And would their world come tumbling down because of that?

So we could start by knowing what is the Session Length (in minutes) and how you've defined the Session Handler in the Global Configuration.

I guess I could understand when someone bookmarks a "member-only" URL and clicks the bookmark and then they'll see the login challenge again. That's just the nature of the beast. To what extent does it matter if they face a page that asks them to complete the login form and the URL for that page has a URL with "/component/users/?view=login&Itemid=696" in it, as opposed to a page that has "login" in the URL? ???

The next part of the problem is to understand how your website environment has been engineered in the first place. We could gain a lot of useful information if we saw the Forum Post Assistant report but I understand, from what you've written elsewhere on the forum, your reluctance to use the FPA tool. Ah well, comme-çi comme-ça, we all have our own reasons for using or not using the FPA and I can respect yours.

Let's suppose we could redirect https://gofishcity.com/component/users/ ... Itemid=696 to https://gofishcity.com/login ... (although I can't say that I've tried to do something like this before). How would we go about making that redirection? You've told us that you've tried to use .htaccess and it produces 404s ... so that's not much to work with, is it?

As far as a solution goes for how to achieve this "redirection" when clicking something that one is not entitled to "click", I don't know the answer. I guess the solution would be to rewrite Joomla ... (but that may be overkill). I don't know of a built-in setting that says "Redirect everyone to 'this page''" ... whatever 'this page' may happen to be. Perhaps someone else may have better answer (or a real solution)?

Have you tried using the Redirects component?

rmarcant
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Jan 19, 2010 6:48 pm

Re: htaccess URL redirect

Post by rmarcant » Sun Jul 26, 2020 1:53 am

Yes I've tried the redirect component. Doesn't work because that link https://gofishcity.com/component/users/ ... Itemid=696 isn't an Expired Link so it's not working. If I could figure out how to make it an expired link, then maybe it would work. Ideas on how to make it an expired link?
  • view=login seems to be the Joomla login page since it shows up on the site but unusable. And not the login page I want users to go to which is https://gofishcity.com/login
And currently session length is set to 240 while I'm building and test the site.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31084
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: How do I redirect the URL for one of my pages to a SEF URL?

Post by Per Yngve Berg » Sun Jul 26, 2020 8:05 am

The problem is that the Menu Item "Login" goes to an extension. It does not point to com_users.

You may create a Menu Item that points to com_users.

rmarcant
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Jan 19, 2010 6:48 pm

Re: How do I redirect the URL for one of my pages to a SEF URL?

Post by rmarcant » Sun Jul 26, 2020 2:16 pm

Not a problem that menu item "Login" goes to an extension. It works fine. Don't want it pointing to com_users. I want com_users to redirect to "/login" as stated above and everything I've tried isn't working.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31084
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: How do I redirect the URL for one of my pages to a SEF URL?

Post by Per Yngve Berg » Sun Jul 26, 2020 2:41 pm

The Joomla router does not find "Login" because it searches for com_user. That's why you end up with the default menu item.

Is this the extension you are using?

https://extensions.joomla.org/extension ... ced-login/

It's a module, you cannot have a menu item pointing to it. What menu item type is login?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31084
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: How do I redirect the URL for one of my pages to a SEF URL?

Post by Per Yngve Berg » Sun Jul 26, 2020 2:49 pm

I use this plugin to prevent the session from expiring.

https://extensions.joomla.org/extension/session-keeper/

rmarcant
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Jan 19, 2010 6:48 pm

Re: How do I redirect the URL for one of my pages to a SEF URL?

Post by rmarcant » Sun Jul 26, 2020 3:14 pm

Thanks but that doesn't address the issue. When this page comes up https://gofishcity.com/component/users/ ... Itemid=696, All I'm asking here is help to find a way to redirect this page or the directory /componnent/users/ to https://gofishcity.com/login. Surely there's a way to do this either in htaccess, Joomla Redirects or on in a server directory?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31084
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: How do I redirect the URL for one of my pages to a SEF URL?

Post by Per Yngve Berg » Sun Jul 26, 2020 5:20 pm

Code: Select all

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
RewriteCond %{QUERY_STRING} view=login
RewriteCond %{REQUEST_URI} /component/users
RewriteRule ^component/users /login? [R=301,L]
#
## End - Custom redirects
Note: The comments is already present in your .htaccess file. Place at that location.

rmarcant
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Jan 19, 2010 6:48 pm

Re: How do I redirect the URL for one of my pages to a SEF URL?

Post by rmarcant » Sun Jul 26, 2020 11:28 pm

Thank you! Thank you! Thank you! That worked! Blessings.

rmarcant
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Tue Jan 19, 2010 6:48 pm

Re: How do I redirect the URL for one of my pages to a SEF URL?

Post by rmarcant » Fri Jul 31, 2020 5:22 pm

On the same subject, I have another link that is going to the wrong login. It needs to go to /login and not the standard joomla login page. Can you provide code for htaccess to make that happen?

It's going to this page, https://gofishcity.com/login-form when it should go to /login
In joomla admin the link is index.php?option=com_users&view=login


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”