htaccess

Create a redirection form /public/ to base using htaccess in PHP.

.htaccess is a configuration file used by web servers to control how web traffic is handled. It can be used to create URL redirections, block access to certain files or directories, and more.

To redirect traffic from /public/ to base using .htaccess in PHP, follow these steps:

1. Create a file called .htaccess in the root directory of your website if it doesn’t already exist.

2. Add the following code to the .htaccess file to enable URL rewriting:

“`
RewriteEngine On
RewriteBase /
“`

3. Add the following code to redirect traffic from /public/ to the base URL:

“`
RewriteRule ^public/(.*)$ /$1 [L,R=301]
“`

This code tells the web server to redirect any traffic that starts with /public/ to the base URL. The [L] flag indicates that this is the last rule to be processed, and the [R=301] flag indicates that this is a permanent redirect.

Here’s the full code for the .htaccess file:

“`
RewriteEngine On
RewriteBase /
RewriteRule ^public/(.*)$ /$1 [L,R=301]
“`

Make sure to save the .htaccess file and upload it to the root directory of your website.

I hope this helps you understand how to create a redirection from /public/ to base using .htaccess in PHP.

Updated on March 10, 2023

Was this article helpful?

Related Articles

longest penish in the world bliss adult arcade & theater swingers club fucknude.net bi sexual black porn beautiful women pictures nude, old men with young women porn massage hiden cam porn fuckhd.org reality kings money talks big titty sucking lesbians, realty king porn hub n i x l y n k a nudevids.org phineas n ferb porn ghost in the shell - kusanagi motoko animation
Linda had been playing the spanking game with her boyfriend all night. They had been drinking and dancing and making each other giga720p.com laugh until they were both too drunk to stand. When they finally stopped for the night, Linda followed her boyfriend into his pornodocs.com bedroom, where he promptly fell asleep. Linda was horny and wanted to feel his hand smacking her butt, so she quietly got nudepornos.com out of bed and pulled down her panties. She went to the door to make sure her boyfriend was still asleep and pornobold.com then crept out of the room. Linda went down the hall to her own room, where she quickly undressed and got into bigtitscollege.com bed. She was lying there, thinking about how she was going to get her boyfriend's hand on her butt when she heard bigtitskit.com a noise coming from his bedroom. Linda slowly got out of bed and tiptoed to the door, where she peeked her head bathhd.com through the crack to see her sleeping boyfriend with his hand resting on his bare butt. Linda quickly stuck her head back gfsbonk.com inside the room and closed the door, laughing uncontrollably