Answer the question
In order to leave comments, you need to log in
How to redirect subdomain to admin.php entry point?
Good afternoon,
I have an admin panel with an entry point example.com/admin.php
How do I set up .htaccess so that the admin.example.com subdomain is directed to admin.php ?
In the settings of the main domain example.com, the subdomain admin.example.com is specified as ServerAlias
I tried this:
# RewriteEngine
<IfModule mod_rewrite.c>
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REMOTE_HOST} ^admin.*
RewriteRule . admin.php[L]
# otherwise forward it to index.php
RewriteRule . index.php
</IfModule>
Answer the question
In order to leave comments, you need to log in
Not sure, but:
RewriteCond %{HTTP_HOST} ^admin
RewriteRule . http://example.com/admin.php[L]
soon somehow
RewriteCond %{HTTP_HOST} ^www\.admin.example\.com [OR]
RewriteCond %{HTTP_HOST} ^admin\.example\.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !admin.php$
RewriteRule ^(.*)$ /admin.php [L]
Well, if in a simple way, then two tables.
In the language table, we store IDs (PK) and the names of available languages. In the table of values, we store the value for the phrase, its id (PK) and language id (FK) . Communication is one-to-many, the database is normalized according to 3NF. When adding the language/meaning of the phrase, the number of tables will not grow.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question