Advertisement
Jambix64

Write File Htaccess

Jun 21st, 2019
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2.  
  3. $endMod = "</IfModule>";
  4.  
  5. $nameServer = array(
  6.   "game1",
  7.   "game2",
  8.   "game3"
  9. );
  10.  
  11. $arrays = array(
  12.   "<IfModule mod_rewrite.c>",
  13.   "RewriteEngine On",
  14.   "RewriteRule ^index/?$ index.php",
  15.   "RewriteRule ^home/?$ index.php",
  16.   "RewriteRule ^connect/?$ connection.php",
  17.   "RewriteRule ^choose/?$ choose.php",
  18. );
  19.  
  20. $htMod = count($arrays);
  21. $countSrv = count($nameServer);
  22.  
  23. for ($i = 0; $i < $htMod;$i++) {
  24.  
  25.  
  26.   echo "Count=".$i."Array=".$arrays[$i]."<br>";
  27.  
  28.   if (isset($arrays[$i + 1]) == null) {
  29.  
  30.     for ($j = 0; $j < $countSrv;$j++) {
  31.  
  32.       $i = $i + 1;
  33.  
  34.       $arrays[$i] = $nameServer[$j];
  35.  
  36.       if (isset($nameServer[$j + 1]) == null AND  isset($arrays[$i + 1]) == null) {
  37.         $arrays[$i + 1] = $endMod;
  38.         break;
  39.       }
  40.     }
  41.   }
  42. }
  43.  
  44. $newSize = count($arrays);
  45.  
  46. for ($k = 0; $k < $newSize;) {
  47.  
  48.   $k++;
  49.   echo $arrays[$k] . "<br>";
  50.  
  51. }
  52.  
  53. //"RewriteRule ^".$webName . "/?$ app/template/" . $webName . "/index.php",
  54.  
  55.  
  56.   //$dec = (int)$description[$i];
  57.   // echo $description[$i] . "\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement