Answer the question
In order to leave comments, you need to log in
How to use php to make many different pages from 1 template page?
Let's say there is an index.php file at the root of the directory. You can access this file by the conditional link site.ru. How can I make it using php so that when I go to the site.ru/second site, I get an index.php page with data taken from the subd?
Answer the question
In order to leave comments, you need to log in
# .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ([^?]+) index.php?%{QUERY_STRING}&p=$1 [L]
<?php // index.php
echo $_GET['p'];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question