Advertisement:

Author Topic: public-profile url format  (Read 4502 times)

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
public-profile url format
« on: October 18, 2018, 08:51:30 am »
hey,
osclass public-profile url format is like this: website.com/profile/user-name
is there a way to make it like this? website.com/user-name
thanks

Resta

  • Sr. Member
  • ****
  • Posts: 345
Re: public-profile url format
« Reply #1 on: January 03, 2019, 05:00:31 am »
Once you enable the default permalinks it is not possible to do any other cursom url rewrite rules - it is all or none.

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: public-profile url format
« Reply #2 on: March 22, 2019, 10:31:01 pm »
Any help?

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
.
« Reply #3 on: March 23, 2019, 06:20:28 pm »
.
« Last Edit: March 24, 2019, 12:08:46 am by Sophia_OS »

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: public-profile url format
« Reply #4 on: March 24, 2019, 01:20:46 am »
Short: NOT possible

Little longer: Maybe with heavy modifications to /oc-includes/osclass/classes/Rewrite.php...

Regards.

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: public-profile url format
« Reply #5 on: March 24, 2019, 06:25:07 am »
Short: NOT possible

Little longer: Maybe with heavy modifications to /oc-includes/osclass/classes/Rewrite.php...

Regards.

@Patrick
Here we could easily make items like this: website.com/item7566
Dashboard → Settings → Permalinks → Listing URL: item{ITEM_ID}

Why and what is the reason that osclass didn't give us that option for public-profile URL?

Thank you for addressing me the Rewrite.php file. Let me work a little on this file and see if we could make this happen.
Thanks
« Last Edit: March 24, 2019, 06:27:32 am by Sophia_OS »

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: public-profile url format
« Reply #6 on: March 24, 2019, 08:39:08 pm »
i tried and could not solve this by Rewrite.php file.
can we do this by htaccess file?

Web-Media

  • Sr. Member
  • ****
  • Posts: 453
  • Web
Re: public-profile url format
« Reply #7 on: March 25, 2019, 04:23:03 pm »
Short answer .. yes you can by adding routes . But that depends on the number of users .  More users harder  and slower to match . Www.yoursite/london  it is a user called london a category called london  ot a city called london ?  You have to make sure that your user names do not match either cities in your database or category name . Thats the short version . The long version will take some hours to write the answer and weeks to think and  implement a new router inside  some routes

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: public-profile url format
« Reply #8 on: March 25, 2019, 06:13:52 pm »
And I guess that if you make a route you need to change url from original to route in all core files?

Web-Media

  • Sr. Member
  • ****
  • Posts: 453
  • Web
Re: public-profile url format
« Reply #9 on: March 25, 2019, 08:30:38 pm »
No need to change core files . Just add username as route name . But like ive said .. implementint a username strategy on user register or edit username  not allow names that already exist as city region or categoryY've made some tests with  works well  under 10 000 routes . Matching  the route under 0.1 sec . With 512 mb ram.. shared hosting...  But if the number of routes increases ,more memory is needed more time will be consumed ,and some changes to rewrite class to match faster . Now it used foreach  routes as route {preg match  }  . You will have to implement a diferent strategy with static routes .

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: public-profile url format
« Reply #10 on: March 25, 2019, 08:39:22 pm »
Short answer .. yes you can by adding routes . But that depends on the number of users .  More users harder  and slower to match . Www.yoursite/london  it is a user called london a category called london  ot a city called london ?  You have to make sure that your user names do not match either cities in your database or category name . Thats the short version . The long version will take some hours to write the answer and weeks to think and  implement a new router inside  some routes

@Web-Media
That's an easy fix. We could add a variable at the beginning of user-name.
$users = 'user-'
$users{USER-NAME}
And we never get that kind of problems.

Please help us to do by adding routes!
Thanks,

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: public-profile url format
« Reply #11 on: March 25, 2019, 08:48:42 pm »
No need to change core files . Just add username as route name . But like ive said .. implementint a username strategy on user register or edit username  not allow names that already exist as city region or categoryY've made some tests with  works well  under 10 000 routes . Matching  the route under 0.1 sec . With 512 mb ram.. shared hosting...  But if the number of routes increases ,more memory is needed more time will be consumed ,and some changes to rewrite class to match faster . Now it used foreach  routes as route {preg match  }  . You will have to implement a diferent strategy with static routes .

When a user registers, by default user-name is user-id. And after that if we disable user-name changes for users, problem will be solved. Or as i explained above we could add a varibale at the beginning of user-name.

Web-Media

  • Sr. Member
  • ****
  • Posts: 453
  • Web
Re: public-profile url format
« Reply #12 on: March 25, 2019, 08:50:49 pm »
And what is the diference between
Yoursite.com/profile/cristiano-ronaldo
And
Yoursite.com/user-cristiano-ronaldo
?

Web-Media

  • Sr. Member
  • ****
  • Posts: 453
  • Web
Re: public-profile url format
« Reply #13 on: March 25, 2019, 08:58:24 pm »
Or you can create a single route as new entry point of your website and  you've just create a new index controller .
From there you can define  a new url matching  for items categories regions cities and users  and use an external library as your main router.

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: public-profile url format
« Reply #14 on: March 25, 2019, 09:00:02 pm »
And what is the diference between
Yoursite.com/profile/cristiano-ronaldo
And
Yoursite.com/user-cristiano-ronaldo
?

What is the difference between these two?

example.blogspot.com
and
example.blog.blogspot.com

The difference is to make it easy for users!