0

I want to point my subdirectory folder like this

www.FOLDERNAME.SITE_NAME.net

and write now its working like this

www.SITE_NAME.net/FOLDER_NAME

I already made a domain for my folder

I tried many htaccess but no luck at all.

Any help will be highly appreciated.

  • What's the use case for this? What have you tried so far? – FluffyJack Sep 14 '12 at 08:38
  • can you paste the htacces for www.SITE_NAME.net/FOLDER_NAME format which was not working and htaccess for www.SITE_NAME.FOLDER_NAME.net which is not working , so that we can help you out – Aravind.HU Sep 14 '12 at 08:38
  • This is a duplicate question actually. View this question for an answer: http://stackoverflow.com/questions/1588371/pointing-a-subdomain-to-a-subfolder-using-htaccess – FluffyJack Sep 14 '12 at 08:39

2 Answers2

3

Hi did you try this one.

 RewriteCond %{HTTP_HOST} ^FOLDERNAME\.SITE_NAME\.net$ [NC]
 RewriteCond %{REQUEST_URI} !^/FOLDERNAME/
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ /FOLDERNAME/$1
 RewriteCond %{HTTP_HOST} ^FOLDERNAME\.SITE_NAME\.net$ [NC]
 RewriteRule ^(/)?$ FOLDERNAME/index.php [L]

I did not Try but I am sure it will work out your problem.

feel free to ask on the same.

Rajat Modi
  • 1,343
  • 14
  • 38
0

TRY ( not tested )

RewriteEngine on

RewriteRule folder_name\.%{HTTP_HOST}%\.net
www.%{HTTP_HOST}%\.net/folder_name [NC,R=301,L,QSA]
xkeshav
  • 53,360
  • 44
  • 177
  • 245