Url forwarding by company

Asked

Viewed 41 times

2

  • Want to rewrite the url redirecting to which system page? empresa1/home wants to point to where?

  • the real address and www.teste.com.br/folder here has the login view that checks the user and from which company it is, then load the information, which I want the user to enter his company name at the end of the url www.teste.com.br/companyso , businessfulano would be a folder mask, keeping in the company name on login

  • Okay, I changed the rule to send the company name, make sure that’s what you need.

  • look vo and test

  • Comment if you need more parameters to change the answer, just tell me which ones?

  • 5 months ago I finished college, and I’m working as a freelancer in my spare time, has a lot of knowledge yet

Show 2 more comments

1 answer

3


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

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

Any url starting with characters from ([a-Z0-9]+) preceded by a name with letters or numbers may have one or more characters, redirects to your system page passing the company name as parameter. Change index.php to the system homepage if different.

I changed to remove home in this case ai from above only works 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 numerical parameter, note that I added the expression [0-9] which indicates that it serves any number of 0 to 9, the + sign in front of the expression indicates one or more numeric characters. It works with letters like this [a-z], or any character from a to z minuscule is accepted.

  • 1

    company was just an example each company has its name, as if it were several urls, www.teste.com.br/oficinatide, www.teste.com.br/ilmarmotos, www.teste.com.br/bicicletariadotadeu, something like this, according to what type the system takes the company name parameter and can accept other parameters in front, the system will always intend that the company name in reality is a folder but

  • 2

    Yes I took, after explained in the comment the idea is this, I suggested below without the home. Adapt your needs

  • 1

    I explained there wrong, the home does not display in the browser, it is only www.teste.com.br/companyso this is the home address

  • 1

    did not work because that htaccess at inside the enginesystem folder, https://apoenatec.com.br/enginesystem/login the enginesysem I wanted that was different

Browser other questions tagged

You are not signed in. Login or sign up in order to post.