I would like to upload the locally developed wordpress site to the repository on Gitlab so that it can be accessed in the domain for testing.

Asked 2 years ago, Updated 2 years ago, 453 views

I cannot see any wordpress files uploaded on Gitlab on my company's server, I cannot access wp-admin, wp-login.php, and 404 page not found, so I would appreciate your advice.

Even if I upload the wordpress file in the same way for other projects, there is no problem like this, and no matter how much I look into it, it cannot be solved...My senior is not paid, so I would appreciate it if someone could help me.

What do you want to do
I would like to upload the locally developed wordpress site to the repository on Gitlab so that it can be accessed in the domain for testing.

Current State
Wordpress sites created with local MAMP are displayed successfully.
The domain name is https:// Theme Name.preview.sample.de/

I'm using the original theme.
The path is wp-content->themes->original theme->index.php,front-page.php..etc

Tried
1) Add the following to wp-config.php=>Not Found
define('WP_DEBUG', true);// No errors are displayed
define('WP_HOME', 'https:// Theme name .preview.sample.de/');
define('WP_SITEURL', 'https:// Theme name .preview.sample.de/');

2) Edit .htaccess as follows (Two RewriteBase and RewriteRule are written, but I commented out and tried one of them, but 404 appears) =>Not Found

// Some excerpts
BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule.* - [E=HTTP_AUTHORIZATION: %{HTTP:Authorization}]
RewriteBase / Theme Name / 
RewriteBase/
RewriteRule^index\.php$ - [L]
US>RewriteCon%{REQUEST_FILENAME}!-f
RewriteCon%{REQUEST_FILENAME}!-d
RewriteRule. / Theme Name / index.php [L] 
RewriteRule./index.php [L]
</IfModule>

END WordPress

3) Delete .htaccess and access https:// Theme Name .preview.sample.de/=>Not Found

I believe that the URL does not exist for some reason or that the writing of .htaccess is a problem, but if there are any other possible reasons, I would appreciate it if you could comment on them.
The screenshot is all the wordpress files uploaded on Gitlab.
Thank you.
Uploaded file
Uploaded Files

This question was also asked in teratail.

wordpress .htaccess gitlab

2022-09-30 21:59

2 Answers

GitLab is just a "version management system = file storage" and WordPress (PHP) will not work as a program no matter how many files you upload here.

For WordPress to work, I think you need to upload the file to the area managed by the web server (Apache, Nginx, etc.).


2022-09-30 21:59

You can deploy (deploy) automatically using the Git hook, but
You must have permission to create a post-receive file and write a shell script in the custom_hooks in the GitLab repository, and to write a shell script to copy the file.


2022-09-30 21:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.