Osclass forums
Development => Development => Topic started by: Sophia_OS 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
-
Once you enable the default permalinks it is not possible to do any other cursom url rewrite rules - it is all or none.
-
Any help?
-
.
-
Short: NOT possible
Little longer: Maybe with heavy modifications to /oc-includes/osclass/classes/Rewrite.php (https://github.com/osclass/Osclass/blob/master/oc-includes/osclass/classes/Rewrite.php)...
Regards.
-
Short: NOT possible
Little longer: Maybe with heavy modifications to /oc-includes/osclass/classes/Rewrite.php (https://github.com/osclass/Osclass/blob/master/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
-
i tried and could not solve this by Rewrite.php file.
can we do this by htaccess file?
-
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
-
And I guess that if you make a route you need to change url from original to route in all core files?
-
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 .
-
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,
-
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.
-
And what is the diference between
Yoursite.com/profile/cristiano-ronaldo
And
Yoursite.com/user-cristiano-ronaldo
?
-
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.
-
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!
-
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.
This is really hard for me to write the code :-\
-
Hmmm you can also hook into
osc_run_hook( 'init_user_non_secure' ); and (init_user ) hook to get the action user id .... and redirect to a single user route.
-
Hmmm you can also hook into
osc_run_hook( 'init_user_non_secure' ); and (init_user ) hook to get the action user id .... and redirect to a single user route.
:-[ would you please write the code example!
-
I found this page in google!
https://stackoverflow.com/questions/30237861/in-osclass-change-http-domainname-user-profile-1-to-http-domainname-username
-
Change in the db rewrite_user_profile to users and you ll get
Yoursite /users/messi
-
Change in the db rewrite_user_profile to users and you ll get
Yoursite /users/messi
Yes your right. That doesn't solve the problem!
-
And you will get another problem
How about
Yoursite.com/cristiano-ronaldo/videos
Yoursite.com/cristiano-ronaldo/videos/2
Yoursite.com/cristiano-ronaldo/videos/2/asc
Yoursite.com/cristiano-ronaldo/news ....
Keeping the
https://demo.osclass.org/general/user/profile/cristiano?iPage=2
Is the best options
Because you keep options for further plugins for users
Like
https://demo.osclass.org/general/user/videos/cristiano?iPage=2
https://demo.osclass.org/general/videos/cristiano/Page=2
https://demo.osclass.org/general/user/news/cristiano?iPage=2
-
https://demo.osclass.org/general/?cristiano
https://demo.osclass.org/general/?cristiano-ronaldo/10/6
Match your needs ?
-
You can use the main controller to display the user profile page
Just hook into init_main to see if arguments in $_SERVER['REQUEST_URI'] and display main page or user profile page if arguments username ,items per page ,ipage
-
And you will get another problem
How about
Yoursite.com/cristiano-ronaldo/videos
Yoursite.com/cristiano-ronaldo/videos/2
Yoursite.com/cristiano-ronaldo/videos/2/asc
Yoursite.com/cristiano-ronaldo/news ....
Keeping the
https://demo.osclass.org/general/user/profile/cristiano?iPage=2
Is the best options
Because you keep options for further plugins for users
Like
https://demo.osclass.org/general/user/videos/cristiano?iPage=2
https://demo.osclass.org/general/videos/cristiano/Page=2
https://demo.osclass.org/general/user/news/cristiano?iPage=2
I have only one category.
And here for user profile i just put (profile)
Dashboard → Settings → Permalinks → User profile: profile
Now my public-profile format is: mysite.com/profile/user-name
And im trying to remove "profile" from the url to be: mysite.com/user-name
-
https ://yoursite/?cristiano
https ://yoursite/?cristiano-ronaldo/10/6
Match your needs ?
-
https://demo.osclass.org/general/?cristiano
https://demo.osclass.org/general/?cristiano-ronaldo/10/6
Match your needs ?
I don't want category name to show in public-profile.
-
there is no category name its just osclass demo setup https://demo.osclass.org/jobboard/
we are talking about this
https ://yoursite/?cristiano
https ://yoursite/?cristiano-ronaldo/10/6
-
https ://yoursite/?cristiano
https ://yoursite/?cristiano-ronaldo/10/6
Match your needs ?
Would you please remove "?" From the url!
-
there is no category name its just osclass demo setup https://demo.osclass.org/jobboard/
we are talking about this
https ://yoursite/?cristiano
https ://yoursite/?cristiano-ronaldo/10/6
Got you! This is good if you remove "?" from the url!
-
This is what i need to show the public-profile!
https ://yoursite.com/cristiano-ronaldo
-
How many users do you have ?
-
How many users do you have ?
Right now im working on localhost!
But for that problem i will add a string variable to the beginning of usernames!
-
https ://yoursite/?cristiano
https ://yoursite/?cristiano-ronaldo/10/6
Match your needs ?
Can't you remove question mark from the url?
-
Hmmm you can also hook into
osc_run_hook( 'init_user_non_secure' ); and (init_user ) hook to get the action user id .... and redirect to a single user route.
Please explain this more!
If we redirect to single user route, we get 404.php, because there is no route for that! Right?
-
You can use the main controller to display the user profile page
Just hook into init_main to see if arguments in $_SERVER['REQUEST_URI'] and display main page or user profile page if arguments username ,items per page ,ipage
How can we redirect to a page that there is no route for that?
I guess we have to first create route for that and then redirect! Am i correct?
-
Yes y've told you . Using routes .
Routes takes precedence over rewrite rules .
$users=User::newInstance->listAll();
Foreach (users as user){
IF (user is active)
{Osc_add_route(user['name'],user['name']...yourpluginfile
} }
Then function
User_redirect (){
If(params::getParam(action)=='pub_profile'){
Params:getParam(username);
Params.....( ipage);
Params.... (itemsperpage)
Osc_redirect_to(osc_get_route_url(username,itemsperpage,ipage)}
}
Osc_add_hook('init_user_non_secure')...
Ask someone to build a simple plugin for you.
This works well with under 5000-10000-40000 users depends on your server hosting setup.
-
You can use the main controller to display the user profile page
Just hook into init_main to see if arguments in $_SERVER['REQUEST_URI'] and display main page or user profile page if arguments username ,items per page ,ipage
How can we redirect to a page that there is no route for that?
I guess we have to first create route for that and then redirect! Am i correct?
Here there is no need for route
Just check the existence of ? In rewrite uri
Get username
If exist and active...
Explode on / to get extra params if exists...
If no ? Display main theme file
If ? exists display public profile pagewith params
Also the redicrect user modified to redirect to main with parameters from above hooked into user controller
-
Yes y've told you . Using routes .
Routes takes precedence over rewrite rules .
$users=User::newInstance->listAll();
Foreach (users as user){
IF (user is active)
{Osc_add_route(user['name'],user['name']...yourpluginfile
} }
Then function
User_redirect (){
If(params::getParam(action)=='pub_profile'){
Params:getParam(username);
Params.....( ipage);
Params.... (itemsperpage)
Osc_redirect_to(osc_get_route_url(username,itemsperpage,ipage)}
}
Osc_add_hook('init_user_non_secure')...
Ask someone to build a simple plugin for you.
This works well with under 5000-10000-40000 users depends on your server hosting setup.
No i don't like plugins. I'm trying to do by hook in functions.php or editing the codes.
Why do you thing that this dosnt work for users more than 40,000? Please explain this a little more!
-
You can use the main controller to display the user profile page
Just hook into init_main to see if arguments in $_SERVER['REQUEST_URI'] and display main page or user profile page if arguments username ,items per page ,ipage
How can we redirect to a page that there is no route for that?
I guess we have to first create route for that and then redirect! Am i correct?
Here there is no need for route
Just check the existence of ? In rewrite uri
Get username
If exist and active...
Explode on / to get extra params if exists...
If no ? Display main theme file
If ? exists display public profile pagewith params
Also the redicrect user modified to redirect to main with parameters from above hooked into user controller
First i check the url, if its public-profile url, redirect to mysite.com/user-name. But i get 404 error!
Please write the code for this!
-
Do use a website like peopleperhour.com or freelancer.com
You will get good job done fast .
-
Meanwhile i'll build the plugin to override default rewrite class and controllers for different purposes . But that require more time .
-
can we do this by: osc_add_route() ?
https://doc.osclass.org/Using_routes_in_Osclass
-
inside a plugin yes
-
inside a plugin yes
Okay so lets use this function and make a plugin step by step here :D
I did alot of search to find osc_add_route() function :)
-
We change this url:
With permalink: mysite.com/profile/user-name1
Without permalink: mysite.com/index.php?page=user&action=pub_profile&id=1
To this:
mysite.com/user-name1
What values should i put for arguments in this function:
osc_add_route($id, $regexp, $url, $file)
-
https://github.com/osclass/plugin-routes_example
Where did you get the idea of yoursite.com/user-cristiano1 ?
You will nedd a separator between name /itemsperpage/page
You are on dinamic routes
-
Your options are
Using rewrite
Site.com/users/cristiano?ipp=10&page=2
Using routes
Site.com/cristiano/10/2
Or site.com/user-cristiano/10/2
Using main controller
Site.com/?cristiano/10/2
-
osc_add_route($user[s'username], $user[s'username]/([0-9]+)/([0-9]+)', '$user[s'username]/{my-numeric-param}/{my-own-param}',
Check the db field name .. $user['s_username]...im on mobile
-
osc_add_route($user[s'username], $user[s'username]/([0-9]+)/([0-9]+)', '$user[s'username]/{my-numeric-param}/{my-own-param}',
Check the db field name .. $user['s_username]...im on mobile
But i don't want :
site.com/user-cristiano/10/2
I want:
site.com/user-cristiano
-
Hope you are kidding . And how do you display page 2 , page 5
How do you know how many items per page .
Y did laugh at your joke :) ;D
-
Hope you are kidding . And how do you display page 2 , page 5
How do you know how many items per page .
Y did laugh at your joke :) ;D
i'm so sorry :) i thought that's the public-profile main url! but that's the pages for user's items! sorry!
now for making site.com/user-cristiano we should do this? right?
osc_add_route($user[s'username], $user[s'username]/([0-9]+)/([0-9]+)', '$user[s'username]/{my-numeric-param}/{my-own-param}');
-
osc_add_route($user['s_username'], 'user-'.$user['s_username']/([0-9]+)/([0-9]+)', 'user-'.$user['s_username']/{my-numeric-param}/{my-own-param}','yourplugin_file .php',false,'custom','custom','Profile page of'.$user['s_username']);
-
osc_add_route($user['s_username'], 'user-'.$user['s_username']/([0-9]+)/([0-9]+)', 'user-'.$user['s_username']/{my-numeric-param}/{my-own-param}','yourplugin_file .php',false,'custom','custom','Profile page of'.$user['s_username']);
What should we put for these:
{my-numeric-param}
{my-own-param}
-
Other users please don't just watch, leave your comments and cooperate to solve this topic! Thanks!
-
Use descriptive param name .. like ipp page . Any words will do the job .
Use the same for reverse routing on
osc_route_url....
Y will build you the plugin this week end .
-
Use descriptive param name .. like ipp page . Any words will do the job .
Use the same for reverse routing on
osc_route_url....
Y will build you the plugin this week end .
Thank you!
-
Other users please don't just watch, leave your comments and cooperate to solve this topic! Thanks!
Good advice - you should do the same and "may be I am wrong" when I say this but for the time I have been a member here, I have not come across any threads where you have responded to someone else looking for help or contributed to any other topics, other than those topics where you are looking for solution to your own issues and I think you have more knowledge about osclass than many new users here, whom you can help.
-
Done 98 % . Some small issues with pagination , but works well .
I,ve saved a lot of memory usage by adding 1 single route , not all users in database ;)
No changes in core osclass files .
No changes in theme files.
Yoursite.com /user-cris is available
also with pagination
Yoursite.com /user-cris/10/2
-
Done 98 % . Some small issues with pagination , but works well .
I,ve saved a lot of memory usage by adding 1 single route , not all users in database ;)
No changes in core osclass files .
No changes in theme files.
Yoursite.com /user-cris is available
also with pagination
Yoursite.com /user-cris/10/2
Well done! Would you please share the code with us!
-
Sure. When ready 100% and tested ill upload to github
-
How long does it take? :)
Please also give an option to be able to put a variable at the beginning of user-name!
$var = "user-";
Yoursite.com/$var"user-cris"
Thank you very very much!
-
Sounds better :
Yoursite.com/$var"-cris"
Where var can be user or any string(word)
Yoursite.com/user-cris
-
Sounds better :
Yoursite.com/$var"-cris"
Where var can be user or any string(word)
Yoursite.com/user-cris
Yes! Please make both work!
Default be just user-name. But put an option we could also be able to add $var at the beginning of user-name.
Yoursite.com/cris //default!
Yoursite.com/$var"cris" //option to add variable!
-
@Web-Media,
Did you finish the code?
-
Sorry . Not yet . Y do not have a lot of spare time
-
Question : whitch page do you wanna redirect if user does not exist , is not active, or blocked ?
i'll put main page and search page as options
-
Question : whitch page do you wanna redirect if user does not exist , is not active, or blocked ?
i'll put main page and search page as options
Main page is good!
-
@Web-Media,
Any update?
-
Plugin is done .. pagination works well .
Yoursite .com/$variable-{username}
Yoursite .com/$variable-{username}/2 ... (pagination)
Yoursite .com/$variable-{username}/7/3 ( itemsperpage/page)
Is user is not enabled or active go to (search or main ) admin choise
If user do not exist .. go to search or main .
No changes to core or theme files
Just some finishing touches and to setup a domain demo and upload the free plugin
-
Thank you very much!
-
Thanks
-
Today at 21 -22 i'll send you the plugin
-
Thanks!
-
You have it . Few more test .. and available for free on github
-
@Web-Media Thank you very much!
-
@Web-Media
Please help me to remove the "user-"
Thanks
-
@Web-Media,
how can i check the public-profile without user- ?
-
Don't alter the code i've sent you .
You are trying to achieve big things with simple logic and code lines .
This doesnt work like that .
Without 'user-' there is a different code logic begining with user registration ,user edit and so on .
You have to implement a complete strategy of url rewrite for all posible links
Yoursite/barcelona -> means barcelona is a region or a static page or a user
Yoursite/barcelona/barcelona -> region city
Yoursite/london -> possible user called london
If user is your main interest other links cannot be used
You cannot rewrite all osclass code with a simple question like can you help me ?
First draw the big picture for your website and try to achieve it with simple steps taking into consideration the other steps you have to make .
In programming it is called DRY. Don't repeat yourself .
So building a plugin for urlrewrite yoursite/cristiano have to be script wide and to take into consideration all links combination for your website.
Y'll build this but takes time . Be patient.
-
@Web-Media
But if you remember i had asked you yoursite.com/username and if its possible put $var as an option not as requirement.
Please put an option on plugin to remove (user-) or tell me how to do it!
Thank you!
-
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
that i've said 2 week ago .
Do it yourself . On user registration and user edit check that do not match region,city,category or page or any existent routes . Add routes with usernames
-
@Web-Media
Yes i can check on username registration that checks all pages and locations before giving the username! Thanks you!
Now please explain more about adding routes with username! How can i start?
-
@Web_media
on localhost it works very good,
but on server it doesn't work, why? it successfully redirects to Yoursite.com/user-cris but shows the content of 404 page! why?
-
Any errors on debug log ?
I'll check in my server setup
-
Any errors on debug log ?
I'll check in my server setup
i put this code in config file, but did not see any error!
define('OSC_DEBUG', true) ;
-
Did you find the issue?
-
@Web_media
Did you check it?
-
Did you change the variable from admin setings ?
-
Did you change the variable from admin setings ?
Yes i changed it!
-
i changed it to "user", but still not working!
-
https://forums.osclass.org/development/user-profile-url/ it is public now .
lets see if someone could help debugging
-
The problem must be in the sethpath plugin router . I'll look into it
-
check your htacces file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
-
check your htacces file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
htaccess file is correct!
please check the paths
-
I've had same issue .Didn't get the theme file 404 but server 404. Activating the permalinks somehow doesnt write the htacces file. I've had to edit htacces myself .
-
I've had same issue .Didn't get the theme file 404 but server 404. Activating the permalinks somehow doesnt write the htacces file. I've had to edit htacces myself .
If the problem is htaccess, then why its working on localhost? Because localhost has the same htaccess!
-
It's about rewrite base and public_html folder
-
It's about rewrite base and public_html folder
So why osclass's own routes work good with this htaccess and have no problem with public_html folder?
-
Cannot dive deeper into this htacces .
Had same issue .
Enabling permalinks didn't work for whole site becouse htaccea wasnt updated by osclass . .. seever issue .. script issue .. i dont know.
Solved editing htacces by hand
http://oscmad.com/kb-cris
Plugin works fine
-
Please share with us your htaccess file! Thanks!
-
I just did before .
-
I just did before .
Not plugin! Htaccess file! You solved the issue by editing the htaccess file right?
-
Yes . Htacces
-
Yes . Htacces
Please give us your htaccess file! Thanks
-
This is my htaccess:
Would you please edit this to work?
Thanks,
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
-
Exactly like my htacces . Now . Enable permalinks . See if works for whole website . See if plugin works . Then disable permalinks .. see if plugin works again ..
Let see if others has same issue .
Your domain is the main domain or addon domain ?
Your osclass is inside public_html folder ?
-
Exactly like my htacces . Now . Enable permalinks . See if works for whole website . See if plugin works . Then disable permalinks .. see if plugin works again ..
Let see if others has same issue .
Your domain is the main domain or addon domain ?
Your osclass is inside public_html folder ?
Not working! with Permalinks or without Permalinks!
with Permalinks = it redirects to yoursite.com/user-cris but shows 404.php content!
without Permalinks = it also redirects to yoursite.com/user-cris but shows main.php content!
- domain is main-domain
- i even replaced all the PLUGINS_PATH in index.php with (Path-to-your-Web-document-root + oc-content/plugins/) provided by host, but did the same error again! nothing changed!
- without user_profile plugin, whole website works great with or without Permalinks!
-
Did the user cris exist ?
Is user enabled and active ?
Did you setup the redirect to go to main page when username does not exist or is not active ?
404 from theme file or server 404 default page ?
-
Did the user cris exist ?
Is user enabled and active ?
Did you setup the redirect to go to main page when username does not exist or is not active ?
404 from theme file or server 404 default page ?
Did the user cris exist ? Yes
Is user enabled and active ? Yes
Did you setup the redirect to go to main page when username does not exist or is not active ? No difference. I even changed to go to search.php but with Permalinks it shows the 404.php content and without Permalinks it shows main.php content! (But urls are not main.php or 404.php)
404 from theme file or server 404 default page ? It dosnt show the 404.php in url, it just shows the content of 404.php in bender theme! Because i put a echo 'i am 404 in bender'; and it showed me that! (When i removed the 404.php in bender theme it showed the white page with the message: Not Found, Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.) This was when Permalinks On, whwn Permalinks is off always shows the main.php content no matter i choose main or search in plugin setting!
-
Please someone tells us why @Web_media's plugin works great on localhost but NOT on server! Thanks,
https://github.com/web-media/user_profile
-
@Web-Media
Did you fix that issue?
Thanks
-
Really? In this forum no one knows why this plugin works on localhost but not on server?
If you don't wanna fix it, at least tell me the reason that this plugin dosnt work on the server!
I changed all the plugin path with server path but didn't work!
What could be that there is on localhost and not on server to prevent working?
Please leave your comments
Thanks
-
Please someone tests this plugin on server and let us know that works or not! Thanks!
-
@Web-Media
I found the issue!
i analyzed the plugin, user_profile_custom() function doesn't work on the server! why?
-
Please one of the osclass Admins test this plugin on the server and confirm that doesn't work!
For me on localhost works, but on the server doesn't! And I'm trying to find out why!
Thanks
https://github.com/web-media/user_profile
-
I'll look into it folowing days and rewrite the code with some custom exit statuses to identify the problem faster .
-
I'll look into it folowing days and rewrite the code with some custom exit statuses to identify the problem faster .
Thank you,
Just let you know that i analyzed the plugin and in index.php, function user_profile_custom() doesn't work on server! The reason is init_custom hook doesn't work on the server.
I'm waiting for your reply
Thanks
-
There is 2 ways to land to user profile page .
Typing the url yoursite /var-username .. etc
Or cliking on user link on various parts of the website and plugin redirect to custom page route .
Try accesing both to see if any methods has errors
Actually i've forgot to comment one line in the code index .php line 117 osc_add_route('cris', 'cris', 'cris' , osc_plugin_folder('user_profile/index.php') . 'views/cris.php', false, 'custom', 'pub_profile', __('Profile Page Of ') );
so if you have a user named cris there will be an error
-
@Web-Media
1. There is no "cris" username on my website! That was just example!
2. On the server when i click or type public-profile of any user, it redirects to mysite.com/var-username but content of page is error404. That means it redirects to new url but website dosnt recognize that url! Its like you type a random word at the end of your website: mysite.com/thshdjfbeg and get error!
3. On the server, index.php, user_profile_redirect() function works good, that's why it redirects to new url.
But user_profile_custom() dosnt work, that's why it dosnt route the new url to public-profile. When i change the init_custom hook with before_html hook, function works but inside of the function $route variable gets empty!
4. Please just analize index.php -> function user_profile_custom() on the server. The problem is just this function.
Thank you!
-
@Web-Media
Any update?
-
let see if works .. in index. php a bout line 134
$basePath = rtrim($pathinfo['dirname'],'/');
$router = new \AltoRouter();
$router->setBasePath($basePath);
look for it and replace with the code above
-
@Web-Media
Thank you very much! finally you fixed it :)
now first bug fixed! let's fix the second bug!
second bug:
some browsers, etc, automatically put '/' at the end of url!
when you put '/' at the end of user-name, it gives 404 error!
ex. Yoursite.com/var-username/
Thanks,
-
In your htacces
After
RewriteCond %{REQUEST_FILENAME} !-d
Add
RewriteRule ^/(.*)/$ /$1 [R=301,L]
-
In your htacces
After
RewriteCond %{REQUEST_FILENAME} !-d
Add
RewriteRule ^/(.*)/$ /$1 [R=301,L]
did NOT work,
and also all my CSS did NOT work!
-
Thats server config ..
Try google "remove trailing slash apache"
-
Thats server config ..
Try google "remove trailing slash apache"
but all of the website pages works with "/" except public-profile!
this is a plugin issue! because without plugin it works great!
somewhere in plugin, it checks the route or uri and doesn't accept "/"
please find that part of the code and remove "/" with str_replace
-
Ill look into it
-
Thanks
-
@Web-Media
Any update?
-
classes /router.php
line 180
// strip base path from request url
$requestUrl = substr($requestUrl, strlen($this->basePath));
if( substr($requestUrl, -1) === "/" ){
$requestUrl = substr($requestUrl, 0, -1);
}
// Strip query string (?a=b) from Request Url
-
@Web-Media,
Awesome! Thank you very much!
now let's make this plugin even more powerful by adding search system to this plugin!
i'm waiting for your response!
Thanks again!
-
Hy. This will have to wait a little .
I'm working on rewriting some osclass core code .. without breaking existing installs.
And second .. rewrite from scratch importing external libraries and classes
-
@Web-Media,
Sure, please update here as soon as possible!
Thank you very much!