.htaccess Tips

Hypertext Access, commonly shortened to htaccess, is a configuration file which controls the directory it is placed in and all the subdirectories underneath it. It’s an incredibly useful feature which allows webmasters to control how many aspects of their website works. You can redirect pages, change the extensions of pages, password protect directories and much much more.
So here I write “Rewriting tip using .htaccess” file and how to “Redirect sub domain to sub folder”.

Rewriting tip using .htaccess:

Let us take an example,

suppose Original URL:

and we want our Rewriting URL like below:

Below is the .htaccess Code for the above example

Redirect sub domain to sub folder:

In the above code you have to replace your sub-domain and directory name.


I'm a web developer / PHP programmer. I am also working on custom plugin development of wordpress.