Firstly I have coded my website in localhost than everything goes fine all URL work but when I upload it on the cloud (GCP) the URL is not working(It shows that the URL is not found)
the following code is of .htaccess file in localhost
RewriteEngine On
RewriteBase /blog_site/
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^single_post/(.*)$ single_post.php?post_title=$1
RewriteRule ^single_post/(.*)/ single_post.php?post_title=$1
RewriteRule ^category/(.*)$ category.php?category=$1
RewriteRule ^category/(.*)/ category.php?category=$1
RewriteRule ^author/(.*)$ author.php?author=$1
RewriteRule ^author/(.*)/ author.php?author=$1
RewriteRule ^author/(.*)/(.*)$ author.php?author=$1&user=$2
RewriteRule ^author/(.*)/(.*)/ author.php?author=$1&user=$2
RewriteRule ^search/(.*)$ search.php?search=$1
RewriteRule ^search/(.*)/ search.php?search=$1
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Also use base tag
<base href="/blog_site/" target="_self">
On cloud server the code of .htaccess file is
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^single_post/(.*)$ single_post.php?post_title=$1
RewriteRule ^single_post/(.*)/ single_post.php?post_title=$1
RewriteRule ^category/(.*)$ category.php?category=$1
RewriteRule ^category/(.*)/ category.php?category=$1
RewriteRule ^author/(.*)$ author.php?author=$1
RewriteRule ^author/(.*)/ author.php?author=$1
RewriteRule ^author/(.*)/(.*)$ author.php?author=$1&user=$2
RewriteRule ^author/(.*)/(.*)/ author.php?author=$1&user=$2
RewriteRule ^search/(.*)$ search.php?search=$1
RewriteRule ^search/(.*)/ search.php?search=$1
RewriteRule ^([^\.]+)$ $1.php [NC,L]
and the base tag is
<base href="/" target="_self">
The VM instance link of GCP such that you can see how website behave website link
If I manually type the url http://your_IP/contact.php working. But if I use http://your_IP/contact is not working