All currently logged in users have a Session with their role.
For example I use SESS_ROLE = 2 for users and SESS_ROLE = 3 for companies.
My goal is to have domain.com/profile for both roles. So my question is, is there a way to do it?
Does htaccess have something like if ( sess_role == 2) { .... } else { ... } ?
Or can you suggest me a workaround ?
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/profile/?$ /profile/company.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/profile/?$ /profile/user.php
PHP session data is not generally visible to Apache, EXCEPT for the session ID in the session cookie.
You can use a rewrite map to link a PHP script to a rewrite directive, however, which would let this PHP script expose session data to Apache.