How to Make Site url friendly

3XPOS3D

New Member
OP
Newbie
Joined
Dec 9, 2015
Messages
4
Trophies
0
Age
28
XP
37
Country
notice this for apache based servers.

1.First we need to create a file called
.htaccess in root folder.

2.Let start by enabling mod re-write paste the below code in to the
.htaccess file.

Code:
## Turn On the Rew-Writing Engine
RewriteEngine On

ok great just an fair warning not every host have this enabled so might not work for some.

3.Let say your home page is home.php we going to me it /home/ so the domain will look something like
mysite.com/home/ so let copy the below code to .htaccess

Code:
## Base Dir for home
RewriteRule ^home/$ home.php

great this create the rule for the virtual folder know your code should look like below

Code:
## Turn On the Rew-Writing Engine
RewriteEngine On

## Base Dir for  home
RewriteRule ^home/$home.php

4.Doing great this is the hard part where your calling css & java files or images you will need to do this

Code:
imgs/slider/slider.jpg change to  ../img/slider/slider.jpg

or for css

Code:
css/bootstrap.css change to  ../css/bootstrap.css

5.ok you get the idea how it works so know you can don the second rule for a new page example below.

Code:
## Base Dir for about
RewriteRule ^about/$ about.php

6.As you can see above code is for about page so you get how this works know i hope this is easy enough to follow & have a nice day :P
 
Last edited by 3XPOS3D,
D

Deleted User

Guest
64133285.jpg
 
  • Like
Reactions: Jack_Sparrow

NodePoint

  
Member
Joined
Sep 29, 2015
Messages
164
Trophies
0
Location
that was a lie -- actually somewhere in europe
XP
168
Country
United States
This is to make site URLs look clean.
It looks like this makes it so if you were to go to http://example.com/about then it would pick up about.php but won't redirect you to it.

Note that this code (in the type of format it's using) is for Apache only.
 
Last edited by NodePoint,
General chit-chat
Help Users
  • No one is chatting at the moment.
  • JuanMena @ JuanMena:
    Kissing random dudes choking in celery? Really? Need to study for that?
  • K3N1 @ K3N1:
    Yes it requires a degree
  • K3N1 @ K3N1:
    I could also yank out the rest of my teeth but theirs professionals for that
  • x65943 @ x65943:
    If your throat closes, putting oxygen in your mouth will not solve anything - as you will be introducing oxygen prior to the area of obstruction
  • JuanMena @ JuanMena:
    Just kiss me Kyle.
  • x65943 @ x65943:
    You either need to be intubated to bypass obstruction or create a stoma inferior to the the area of obstruction to survive
  • x65943 @ x65943:
    "Just kiss me Kyle." And I thought all the godreborn gay stuff was a smear campaign
  • JuanMena @ JuanMena:
    If I die, tell my momma I won't be carrying Baby Jesus this christmas :sad::cry:
  • K3N1 @ K3N1:
    Smear campaigns are in The political section now?
  • JuanMena @ JuanMena:
    Chary! Chary! Chary, Chary, Chary!
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
  • Iron_Masuku @ Iron_Masuku:
    Hello
    Skelletonike @ Skelletonike: hmm