![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Posts: 8,053
|
.htaccess question $50 award.
I have multiple dirs like this
/my.subdomain.com/subfolder_1/0001/index.html /my.subdomain.com/subfolder_2/0002/index.html /my.subdomain.com/subfolder_3/0003/index.html They all have their own index.html file. I want to make them share one identical index.html which will be located in /my.subdomain.com/index.html How can i do this with .htaccess? Is it possible or do i need to use symlinks? $50 epassporte to the first one that post the solution. Thank you
__________________
Programs that owe me money ---- Epassporte.com ~ $2700 | Protraffic.com ~ $2600 | XonDemand.com ~ $3000 Email: [email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
If you have ssh access,then you can simply do ln index.html //my.subdomain.com/subfolder_1/0001/index.html
which will create symbolic link to original file.Repeat same command to all subfolders where you want to have identical file. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Nov 2004
Location: Greater Washington DC
Posts: 1,435
|
ln -s /my.subdomain.com/index.html index.html
__________________
Top virtual hosts for under 10$? www.hostmylife.com | icq 50663030 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Posts: 8,053
|
the problem is there are hundreds of subfolders so it needs to be a batch command or something.
__________________
Programs that owe me money ---- Epassporte.com ~ $2700 | Protraffic.com ~ $2600 | XonDemand.com ~ $3000 Email: [email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
Well in htaccess this should work:
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com RewriteRule (.*) http://www.mydomain.com/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !^/web RewriteCond /home/path/to/public_html/%{REQUEST_FILENAME} !-f RewriteCond /home/path/to/public_html/%{REQUEST_FILENAME} !-d RewriteCond /home/path/to/public_html/%{REQUEST_FILENAME} !-l RewriteRule ^(.+) /web$1 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Apr 2002
Location: /root/
Posts: 4,997
|
this works for both situations:
/subfolder/0001/index.html and /subfolder/0001/ Code:
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^(/.*)/index.html$ [OR] RewriteCond %{REQUEST_URI} ^(/.*)?/$ RewriteCond %{REQUEST_URI} !^/index.html$ RewriteRule . /index.html [L] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,409
|
Darksoul... good guy if you need something done on the server!
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Posts: 8,053
|
darksoul provided the best solution so the money was sent to him.
thank you
__________________
Programs that owe me money ---- Epassporte.com ~ $2700 | Protraffic.com ~ $2600 | XonDemand.com ~ $3000 Email: [email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Porn is Dead. Move along.
Industry Role:
Join Date: Aug 2006
Posts: 13,295
|
good work darksoul
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Industry Role:
Join Date: Aug 2008
Location: Hollywood
Posts: 2,785
|
Code:
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^(/.*)/index.html$ [OR] RewriteCond %{REQUEST_URI} ^(/.*)?/$ RewriteCond %{REQUEST_URI} !^/index.html$ RewriteRule . /index.html [L] |
![]() |
![]() ![]() ![]() ![]() ![]() |