To make a new folder as the default domain name , you need to write some code in .htaccess file
For example :
if your domain name is www.yourweb,com
and you want to set a folder named ver1 as primary directory ,
then you need to write some code in .htaccess file to redirect to your ver1 folder as primary domain.
To do this , create a file names .htaccess in the public_html/ directory .
Write the following code in .htaccess file .
Change <DOMAIN> to your domain name .
Change <SUBDIRECTORY> to the path of that folder you like to set to be primary directory.
-------------------------------------------------------------------------------------
.htaccess
-------------------------------------------------------------------------------------
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} <DOMAIN>
RewriteCond %{REQUEST_URI} !^/<SUBDIRECTORY>/(.*) [NC]
RewriteRule ^(.*)$ /<SUBDIRECTORY>/$1
-------------------------------------------------------------------------------------
This code after changing will look like this :
-------------------------------------------------------------------------------------
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} www.yourWebsite.com
RewriteCond %{REQUEST_URI} !^/ver1/(.*) [NC]
RewriteRule ^(.*)$ /ver1/$1
-------------------------------------------------------------------------------------
Home » tips and tricks » Set Folder Name to be working as Primary Domain Name
04 November 2010
Set Folder Name to be working as Primary Domain Name
Other Recommended Posts on tips and tricks
- How to Change favicon in blogspot blog
- How to reopen Closed Tab in Internet Browser
- Set Folder Name to be working as Primary Domain Name
- How to open On-Screen Keyboard in Windows XP
- Open multiple link from single HTML link tag
- How to Open HyperLink Using bat File in Windows XP
- Nokia Phone Quality Check with code
- How to Add Javac to Compile Java code in Windows
- How to Open Multiple links/websites at once with bat file
- Increment a Cell value using button from macro in MS Excel
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment