Today we are going to be setting up the .htaccess file.

I don't know if you know what .htaccess file does.

It's is used to rewrite an unfriendly url to a good looking url.

like for example.

mrbarnk.com/index.php?u=/topic/12/how-to-make-it

is now rewriting to be

`mrbarnk.com/12/how-to-make-it

We achieve that with the help of .htaccess file.

So in this tutorial, we are going to be explaining what .htaccess if and how it should be used.

What the complete video tutorial here.

and this


Options -MultiViews
RewriteEngine On

RewriteBase /mvc_controller/public

#out folder name is mvc_controller
#you can rename it to fit yours.

RewriteCond %{REQUEST_FILENAME} !-d

#check if directory name do not exists.

RewriteCond %{REQUEST_FILENAME} !-f

#check if file name do not exists.

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

#then rewrite the url and every url not to have a index.php extension.
Today we are going to be setting up the .htaccess file. I don't know if you know what `.htaccess` file does. It's is used to rewrite an unfriendly url to a good looking url. like for example. > mrbarnk.com/index.php?u=/topic/12/how-to-make-it is now rewriting to be > `mrbarnk.com/12/how-to-make-it We achieve that with the help of `.htaccess` file. So in this tutorial, we are going to be explaining what .htaccess if and how it should be used. What the complete video tutorial here. https://www.youtube.com/watch?v=-6LyG9I-FPc and this https://www.youtube.com/watch?v=zJxCq6D14eM&index=62&list=PL0eyrZgxdwhwBToawjm9faF1ixePexft- (thumb-up) ``` Options -MultiViews RewriteEngine On RewriteBase /mvc_controller/public #out folder name is mvc_controller #you can rename it to fit yours. RewriteCond %{REQUEST_FILENAME} !-d #check if directory name do not exists. RewriteCond %{REQUEST_FILENAME} !-f #check if file name do not exists. RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] #then rewrite the url and every url not to have a index.php extension. ```

#php, #js, #laravel, #jquery backend developer.

Share      

13
0
1
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft