Please help me How to customize sngine home page

nguyenvanphu

New member
Hello github.com! I come from Vietnam.

I have 1 question:
I am using sngine v3.11
(Because I'm using xampp, I don't have an example to show you)
My homepage is: localhost/sngine
My blog site is: localhost/sngine/blogs

I want my Home page to be: localhost/sngine/blogs

I want when I go to Home page: localhost/sngine, the interface of localhost/sngine/blogs will appear immediately without the link: /blog

I will be extremely happy to do this.

Thank you for helping me!
 

Attachments

  • phu.png
    phu.png
    632.2 KB · Views: 0
To achieve your goal of making localhost/sngine/blogs the homepage (localhost/sngine), you typically need to configure the web server (Apache in XAMPP) to rewrite URLs. Here's how you can approach this:

1. Modify .htaccess (Apache Rewrite Rules)​

In your project directory (localhost/sngine), you may find a file named .htaccess. If it doesn't exist, you can create one. This file is used to define Apache rewrite rules.

Here's a basic .htaccess configuration that you can use to rewrite URLs:

Apache config:
RewriteEngine On
RewriteBase /sngine/

# Rewrite requests to localhost/sngine/ to localhost/sngine/blogs/
RewriteRule ^$ blogs [L]

  • RewriteEngine On: Enables the rewriting engine.
  • RewriteBase /sngine/: Sets the base URL path for rewriting rules.
  • RewriteRule ^$ blogs [L]: This rule captures requests to the root URL (^$) and redirects them internally to /blogs. The [L] flag indicates that this is the last rewrite rule to apply.

2. Save and Test​

Save the .htaccess file in your localhost/sngine directory. Make sure Apache has mod_rewrite enabled. This is usually enabled by default in XAMPP.

3. Verify​

Now, when you access localhost/sngine, it should internally redirect to localhost/sngine/blogs without changing the URL in the browser. Any links or navigation within your application should naturally reference localhost/sngine/blogs.


Best Regard
Danish Hafeez | QA Assistant
ICTInnovations
 
Hello Danish Hafeez! Thanks to you, I did it successfully.

I'm very happy that you were enthusiastic about helping me.

I wish you happiness!

I'm not greedy, because I've bothered you too much

I have 1 LAST problem and I hope Danish Hafeez can help:


Blog posts in sngine do not have a cover image by default (Attach file 1)

I want to use the article image as my profile picture

or

Mandatory Force users to upload images when posting (because upload does not have a mandatory function) (Attach files 2)


Can Danish Hafeez help me again

I am so grateful to you!!

Wishing you well !!
 

Attachments

  • Attach files 1.png
    Attach files 1.png
    44.1 KB · Views: 1
  • Attach files 2.png
    Attach files 2.png
    19.5 KB · Views: 1
  • blogs-upload.txt
    blogs-upload.txt
    912 bytes · Views: 0
To achieve your goal of making localhost/sngine/blogs the homepage (localhost/sngine), you typically need to configure the web server (Apache in XAMPP) to rewrite URLs. Here's how you can approach this:

1. Modify .htaccess (Apache Rewrite Rules)​

In your project directory (localhost/sngine), you may find a file named .htaccess. If it doesn't exist, you can create one. This file is used to define Apache rewrite rules.

Here's a basic .htaccess configuration that you can use to rewrite URLs:

Apache config:
RewriteEngine On
RewriteBase /sngine/

# Rewrite requests to localhost/sngine/ to localhost/sngine/blogs/
RewriteRule ^$ blogs [L]

  • RewriteEngine On: Enables the rewriting engine.
  • RewriteBase /sngine/: Sets the base URL path for rewriting rules.
  • RewriteRule ^$ blogs [L]: This rule captures requests to the root URL (^$) and redirects them internally to /blogs. The [L] flag indicates that this is the last rewrite rule to apply.

2. Save and Test​

Save the .htaccess file in your localhost/sngine directory. Make sure Apache has mod_rewrite enabled. This is usually enabled by default in XAMPP.

3. Verify​

Now, when you access localhost/sngine, it should internally redirect to localhost/sngine/blogs without changing the URL in the browser. Any links or navigation within your application should naturally reference localhost/sngine/blogs.


Best Regard
Danish Hafeez | QA Assistant
ICTInnovations
Can Danish Hafeez help me again
To achieve your goal of making localhost/sngine/blogs the homepage (localhost/sngine), you typically need to configure the web server (Apache in XAMPP) to rewrite URLs. Here's how you can approach this:

1. Modify .htaccess (Apache Rewrite Rules)​

In your project directory (localhost/sngine), you may find a file named .htaccess. If it doesn't exist, you can create one. This file is used to define Apache rewrite rules.

Here's a basic .htaccess configuration that you can use to rewrite URLs:

Apache config:
RewriteEngine On
RewriteBase /sngine/

# Rewrite requests to localhost/sngine/ to localhost/sngine/blogs/
RewriteRule ^$ blogs [L]

  • RewriteEngine On: Enables the rewriting engine.
  • RewriteBase /sngine/: Sets the base URL path for rewriting rules.
  • RewriteRule ^$ blogs [L]: This rule captures requests to the root URL (^$) and redirects them internally to /blogs. The [L] flag indicates that this is the last rewrite rule to apply.

2. Save and Test​

Save the .htaccess file in your localhost/sngine directory. Make sure Apache has mod_rewrite enabled. This is usually enabled by default in XAMPP.

3. Verify​

Now, when you access localhost/sngine, it should internally redirect to localhost/sngine/blogs without changing the URL in the browser. Any links or navigation within your application should naturally reference localhost/sngine/blogs.


Best Regard
Danish Hafeez | QA Assistant
ICTInnovations
Can Danish Hafeez help me again
 
Back
Top