1. 3XPOS3D

    OP 3XPOS3D Newbie
    Newcomer

    Joined:
    Dec 9, 2015
    Messages:
    4
    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, Dec 13, 2015
  2. Essometer

    Essometer Needs data
    Member

    Joined:
    Oct 22, 2010
    Messages:
    700
    Country:
    Germany
    I'm sorry, what?
     
  3. Jack_Sparrow

    Jack_Sparrow Ruthless Pirate
    Banned

    Joined:
    Nov 17, 2015
    Messages:
    855
    Country:
    United States
  4. RainCode

    RainCode   
    Member

    Joined:
    Sep 29, 2015
    Messages:
    164
    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 RainCode, Dec 13, 2015
  5. 3XPOS3D

    OP 3XPOS3D Newbie
    Newcomer

    Joined:
    Dec 9, 2015
    Messages:
    4
    Country:
    Does what RainCode said sorry if my Tutorial are not the best i don't normally type tutorial up so i will do my best to keep them noob friendly
     
    Deleted User likes this.
  6. TotalInsanity4

    TotalInsanity4 GBAtemp Supreme Overlord
    Member

    Joined:
    Dec 1, 2014
    Messages:
    10,811
    Country:
    United States
    You should have this moved to the tutorials section
     
    Deleted User likes this.
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - friendly,