latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

clean url

Home Forums Community Forum clean url

This topic contains 16 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 2 months ago.

Topic Author Topic
Posted: Saturday Oct 20th, 2012 at 1:27 pm #29160
aus_team
Username: austeam

Hey,

can I have clean URL on the address bar?

When my non logged in user access a protected page, they are redirected to a very long url generated by s2.

can that be cleaned so that it looks like, http://mysite.com/?page_id=5 instead of

http://mysite.com/?page_id=5&_s2member_seeking%5Btype%5D=page&_s2member_seeking%5Bpage%5D=545&_s2member_seeking%5B_uri%5D=Lw%3D%3D&_s2member_req%5Btype%5D=level&_s2member_req%5Blevel%5D=0&_s2member_res%5Btype%5D=page&s2member_seeking=page-545&s2member_level_req=0

thanks

List Of Topic Replies

Viewing 16 replies - 1 through 16 (of 16 total)
Author Replies
Author Replies
Posted: Saturday Oct 20th, 2012 at 2:28 pm #29169
Eduan
Username: Eduan
Moderator

Hello there,

You might be able to achieve this using .htaccess, so that it hides that part of the URL, but those variables are required by s2Member in the URL, so you can’t really remove them, only hide them.

– Eduan

Posted: Saturday Oct 20th, 2012 at 4:14 pm #29175
aus_team
Username: austeam

have you tried it?

Posted: Saturday Oct 20th, 2012 at 4:25 pm #29176
Eduan
Username: Eduan
Moderator

Not really, I remember Cristián mentioning something like this, but I’m not sure if it’s possible, you would use the same technology that WordPress uses to hide the .php at the end of every post/page.

I can tell you that s2Member requires that though.

– Eduan

Posted: Sunday Oct 21st, 2012 at 6:14 am #29193
aus_team
Username: austeam

I don’t think it is required because I can visit my members option page without that nasty variable.

Let me try to ask in another way.

so let say for example my member option page is page_id=5

if user access a page that they do not have access level, simply redirect them to page_id=5

is that possible?

Posted: Sunday Oct 21st, 2012 at 10:04 am #29204
Eduan
Username: Eduan
Moderator

All those extra variables are s2Member MOP vars I think, if you are not using MOP vars (which BTW you can find under Dashboard -› s2Member® -› API / Scripting -› Membership Options Page Variables (MOP Vars)) then you can disable that part of s2Member, or hide it with .htaccess.

Remember that those variables only appear when s2Member redirects to the Membership options page, after blocking something, I’m not sure if s2Member uses it for something, but it certainly is useful for debugging problems.

I repeat, if you want to hide that part of the URL, you would have to use .htaccess, the same technology used for hiding the .php, .html etc., at the end of the file URL.

– Eduan

Posted: Monday Oct 22nd, 2012 at 7:43 am #29236
aus_team
Username: austeam

Thanks for trying to explain it to me but upon testing my members option page, I can visit it directly without the ugly url and it works fine. That makes me conclude that in my scenario, it can be use without the ugly url.

Now rephrasing my question.

I want the url to look like as if the user type the member option page directly to the address bar. without anything. My members page works fine I visit the page directly so I don’t understand why those ugly url needs to be there if my members option pages is working without it.

Is it possible to redirect the user on that specific url without the vars. just like a normal redirect will be.

Thanks

Posted: Monday Oct 22nd, 2012 at 9:26 am #29254

Those vars are there in case you want to use them to customize the content of your Membership Options page, or some other hack that’d benefit from them.

You can remove them hacking the mo-page-in.inc.php file. You can try this hack: http://www.s2member.com/forums/topic/bp-redirect-not-working-for-create-blog/#post-22537

I hope that helps. :)

Posted: Monday Oct 22nd, 2012 at 1:29 pm #29283
aus_team
Username: austeam

Great!

This is what I was looking for since day 1 :)

Thanks

Posted: Tuesday Oct 23rd, 2012 at 5:34 am #29364

Glad I could help you. :)

Posted: Saturday Oct 27th, 2012 at 3:48 pm #29931
aus_team
Username: austeam

Hi Christian,

Your hack doesn’t work any more after update.

I applied the hack after updating to the latest version but the ugly url still there.

Hope you have a quick fix for this.

Thanks

Posted: Saturday Oct 27th, 2012 at 4:00 pm #29932
Eduan
Username: Eduan
Moderator

Hello there,

That is because when s2Member gets updated those hacks get re-written. Basically you just gotta hack it again. :)

Hope this helps,
Eduan

Posted: Saturday Oct 27th, 2012 at 4:28 pm #29934
aus_team
Username: austeam

Thanks for the reply but I said I applied the hack “after” updating.

Posted: Monday Oct 29th, 2012 at 1:42 am #29992

I applied the hack after updating to the latest version but the ugly url still there.

That’s odd. Did you make sure you saved the changes after editing?

I just checked the file in the new release and that line hasn’t changed, so the hack is the same and should work as before.

Try copying the file again to your mu-plugins folder and editing it to change that line one more time, please.

Posted: Monday Oct 29th, 2012 at 1:04 pm #30032
aus_team
Username: austeam

That is weird. I do not have mu-plugins folder now at /wp-content/mu-plugins/ but I do have

mo-page-in.inc.php

located at wp-content/plugins/s2member/includes/classes

Is it supposed to be at /wp-content/mu-plugins/ in new version?

  • This reply was modified 4 years, 2 months ago by  aus_team.
Posted: Monday Oct 29th, 2012 at 1:34 pm #30038
aus_team
Username: austeam

Sorry.. my bad.. I was editing the files on the old server. I then remember that I had moved the site.

Sorry for the confusion caused. The hack still works :)

Posted: Tuesday Oct 30th, 2012 at 12:42 pm #30165

Great! Thanks for the update. :)

Viewing 16 replies - 1 through 16 (of 16 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.