Welcome Guest, Not a member yet? Register   Sign In
Redirect to a subdomain in a test website
#1

(This post was last modified: 03-11-2020, 03:28 PM by candicehorie.)

Hello
I have one website and I want to add a testing environment in a subdomain "dev.mywebsite.com", I made a copy from my website inside the subdomain, but I have some issues in how to config the .htaccess file

I have tried rewrite rules and any of them worked.

This is the .htacess file from the main website, how I should do to have a dev.mywebsite working, please?

Code:
DirectorySlash On

RewriteEngine On

RewriteBase /

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]
RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^files/(.*) uploads/$1

RewriteRule ^javascript/(.*) js/$1

RewriteRule ^stylesheet/(.*) css/$1

RewriteRule ^images/(.*) image/$1

RewriteRule ^profile/image/(.*) uploads/profilephotos/$1

<IfModule mod_rewrite.c>

Options -Indexes

RewriteCond $1 !^(index\.php|resources|robots\.txt)

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On

  # Images
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType image/x-icon "access plus 1 year"

  # Video
  ExpiresByType video/mp4 "access plus 1 year"
  ExpiresByType video/mpeg "access plus 1 year"

  # CSS, JavaScript
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"

  # Others
  ExpiresByType application/pdf "access plus 1 month"
  ExpiresByType application/x-shockwave-flash "access plus 1 month"
 
  ExpiresDefault "access plus 2 days"
</IfModule>
Reply




Theme © iAndrew 2016 - Forum software by © MyBB