Finally the main problem was solved
I can now use Aliases. It's working fine with the rewrite rules you posted in this topic. I've only one problem.
I can rewrite with no problems urls like in the following example
domain.tld/index.php?site=forum --rewrite--> forum.domain.tld
domain.tld/index.php?site=articles --rewrite--> blog.domain.tld
domain.tld/index.php?site=files --rewrite--> download.domain.tld
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
# forum.example.com --> /index.php?site=forum
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^forum\.domain\.tld$ [NC]
RewriteRule ^$ /index.php?site=forum [QSA,L]
# blog.example.com --> /index.php?site=article
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^blog\.domain\.tld$ [NC]
RewriteRule ^$ /index.php?site=articles [QSA,L]
# forum.example.com --> /index.php?site=forum
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^download\.domain\.tld$ [NC]
RewriteRule ^$ /index.php?site=files [QSA,L]
This is the problem: let's suppose that i'm in
forum.domain.tld. When i click on "Articles" or "Download" links (index.php?site=articles/files) i'm not redirected to
blog.domain.tld and
download.domain.tld. I'm always in
forum.domain.tld. I want to ask you if i can set a rewrite rule to switch the subdomain or if i need to edit the links in the website. Example:
Article: domain.tld/index.php?site=articles --edit--> blog.domain.tld
Download: domain.tld/index.php?site=files --edit--> download.domain.tld
What is the best way in your opinion?