![]() |
.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 |
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. |
ln -s /my.subdomain.com/index.html index.html
|
Quote:
|
the problem is there are hundreds of subfolders so it needs to be a batch command or something.
|
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 |
this works for both situations:
/subfolder/0001/index.html and /subfolder/0001/ Code:
RewriteEngine On |
Darksoul... good guy if you need something done on the server!
|
darksoul provided the best solution so the money was sent to him.
thank you |
good work darksoul
|
nice done
|
nice working with you
|
Code:
RewriteEngine On |
All times are GMT -7. The time now is 04:17 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123