Home page for sites installed in subfolders
P粉539055526
P粉539055526 2023-09-01 21:17:00
0
1
557
<p>I am using a CMS (PrestaShop) installed in a subfolder of the root directory (shop-1)</p> <p><code>domainName/shop-1</code> index to PrestaShop. </p> <p><code>domaineName/shop-2</code> points to a custom page under PrestaShop. </p> <p>My question is: I want the main domain page <code>domainName/</code> to also point to the second custom page in PrestaShop. The goal is to manage 3 pages using the same CMS. </p> <p>Is this possible with htaccess? What do you think the solution is? </p> <p>PS: I know this can be done with multiple stores, but I think it's over-engineered. </p> <p><strong>Editor:</strong></p> <p>www.domain.com is the main site and there is an old PrestaShop there. </p> <ul> <li>I want to move this site to: </li> </ul> <blockquote> <p>www.domain.com/shop-1</p> </blockquote> <p>This means that all PS built-in URLs will be at <code>/shop1/*</code></p> <ul> <li>I also want another future <code>shop-2</code> </li> </ul> <blockquote> <pre class="brush:php;toolbar:false;">www.domain.com/shop-2</pre> </blockquote> <p>But currently I only need the landing page for shop-2, that's why I considered the CMS page or the module front controller (under the same PS installation). </p> <ul> <li>Now how can I make the root URL www.domain.com point to a URL that can also be managed by the PrestaShop engine? </li> </ul> <p>In other words, I want a PS installation to manage all URLs: </p> <ol> <li>/shop1/* is the page of the old website. </li> <li>/shop-2 is just a front controller page or CMS. </li> <li><code>/</code> The landing page of the entire website is also a Hopefully the front controller page. </li> </ol> <p>Thank you very much dear</p>
P粉539055526
P粉539055526

reply all(1)
P粉481366803

To redirect the main domain page to a custom page in PrestaShop, you can use the RewriteRule directive in the website .htaccess like

RewriteEngine On
RewriteRule ^$ /shop-2 [L]

This tells the server to redirect the root URL to a custom page located at /shop-2. Make sure you have mod_rewrite on your server for it to work properly

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!