AidisProPlayer | 2020-05-30 12:52:05 UTC | #1
<IfModule mod_rewrite.c>
RewriteEngine On
####
# Certain hosts may require the following line.
# If vanilla is in a subfolder then you need to specify it after the /.
# (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
####
RewriteBase /
# Make sure that / doesn't try to go to index.php without a rewrite :)
DirectoryIndex disabled
####
# Deny access to certain directories that SHOULD NOT be exposed.
####
RewriteRule (^|/)\.git - [L,R=403]
RewriteRule ^cache/ - [L,R=403]
RewriteRule ^cgi-bin/ - [L,R=403]
RewriteRule ^uploads/import/ - [L,R=403]
RewriteRule ^vendor/ - [L,R=403]
####
# Prevent access to any php script by redirecting the request to /index.php
# You can add an exception by adding another RewriteCond after this one.
# Example: RewriteCond %{REQUEST_URI} !^/yourscriptname.php$
# You can comment out this section if it causes you problems.
# This is just a nice to have for security purposes.
####
RewriteCond %{REQUEST_URI} !/index.php$
RewriteRule (.+\.php) [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
####
# Redirect any non existing file/directory to /index.php
####
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
####
# Add the proper X_REWRITE server variable for rewritten requests.
####
RewriteCond %{ENV:REDIRECT_X_REWRITE} .+
RewriteCond %{ENV:REDIRECT_X_PATH_INFO} (.+)
RewriteRule ^index\.php - [E=X_REWRITE:1,E=!REDIRECT_X_REWRITE,E=X_PATH_INFO:%1,E=!REDIRECT_X_PATH_INFO,L]
</IfModule>
KrEdEnS | 2020-05-30 13:13:53 UTC | #2
Najprostszym rozwiązaniem wydaje się vhost w serwerze www. Ale może ktoś coś mądrzejszego doda
AidisProPlayer | 2020-05-30 14:06:38 UTC | #3
No takiego rozwiązania na directadmin niema.
Timo | 2020-05-30 15:51:57 UTC | #4
No niestety Direct Admin obsługuje subdomeny jako de facto foldery w domenie.
Z tego, co wiem, możesz jednak za pomocą Rewrite Condition sprawdzać domenę, przez którą łączy się użytkownik. I w zależności, przez którą się łączy korzystać z Rewrite Rule bądź nie.
system | 2020-07-01 15:51:58 UTC | #5
Ten temat został automatycznie zamknięty 32 dni po ostatnim wpisie. Tworzenie nowych odpowiedzi nie jest już możliwe.