hi i've created a staging site on subdomain https://stagin.mysite.com/ for testing purposes and put in on var/www/stagin, is on the same server as live site, staging and live site use different ports.
i created subdomain, pointed DNS, connected the database with Wordpress... changed URL to subdomain on database: define( 'WP_HOME', 'https://stagin.mysite.com' ); define( 'WP_SITEURL', 'https://stagin.mysite.com' );
staging site works. when i access a post, download or page from wordpress dashbord i can enter and see it without problem, but when i click view post, page or download i get: Not Found The requested URL was not found on this server.
it's the case for all my downloads, pages and posts. any help please.
my htaccess content:
I tried this:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^stagin\.mysite\.com$
RewriteRule ^(.*)$ https://stagin.mysite.com/$1 [R=301,L]
<IfModule mod_headers.c>
Header set X-Robots-Tag "noindex, nofollow"
</IfModule>
and this:
<IfModule mod_rewrite.c>
#RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
but with same result
UPDATE:
now I've on my htaccess:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
<IfModule mod_headers.c>
Header set X-Robots-Tag "noindex, nofollow"
</IfModule>
I still have the same error.
this is what I verified:
permalinks structure is postname (the same as my live site)
in /etc/apache2/apache2.conf I have AllowOverride All:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted
what I need
is there something to change in htaccess?
should I change all URLs in database from mysite.com to stagin.mysite.com with:
UPDATE wp_posts SET post_content = replace(post_content, 'https://teesvg.com', 'https://stagin.teesvg.com'); & UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://teesvg.com','https://stagin.teesvg.com');
-in htaccess when I have RewriteEngine On enabled and I go to stagin site homepage I get: Forbidden You don't have permission to access this resource. its not normal but the solution that I found is to disable #RewriteEngine On & change .htaccess permission to 0444 (if I keep it 0644 after some seconds RewriteEngine On is auto enabled.
That's the situation until now and just to remember, the main problem is: staging site works. when i access a post, download or page from wordpress dashbord i can enter and see it without problem, but when i click view post, page or download i get: Not Found The requested URL was not found on this server.
thanks