Url redirection by company

1

I am creating multi tenacy system, I have access page for companies link the views, what I like and that the user type link already go straight into your system keeping the company1 as a mask in the url and link and so on

    
asked by anonymous 18.01.2018 / 17:53

1 answer

2

If I understand you, you just need to add this rewrite to your htaccess:

RewriteRule ^([a-z0-9]+)$  pastasistema/index.php?empresa=$1 [L]

Any url that has characters ([a-z0-9] +) preceded by a name with letters or numbers that may have one or more characters, redirects to the page of your system passing as parameter the company name.Troque index.php for the system home page if it is different.

I changed to remove home in this case, it only works with the parameter name of the company you can add new parameters to your liking, for example:

RewriteRule ^([a-z0-9]+)/([0-9]+)$ ...

This above would be a numeric parameter, notice that I have added the expression [0-9] that indicates any number of 0 to 9 , the + sign in front of the expression indicates one or more characters. The same works with letters that way [a-z] , that is, it accepts any character from a to z minus.

    
18.01.2018 / 18:06