Jump to content

.htaccess modifications for microsite


texxo

Recommended Posts

So, here is what i want to do:

i have a site with www.domain.com

Whenever of course someone goes to www.domain.com it loads normally prestashop etc etc.

What i want to add is this:

Inside the prestashop installation, which is in the root folder of the domain, to create a folder, example: NEWPRODUCT, and to put inside html code from a micropage (for a particular product) - a landing page lets say.

So, what i want is when someone types www.domain.com/NEWPRODUCT or www.domain.com/NEWPRODUCT/ to basically go and load the contents (=the landing page) of that folder.

I tried simply creating a folder and put inside contents from a microsite but when i tried to go to www.domain.com/folder/ it actually pop me the "could not find" screen from prestashop.

So, i guess somehow, the request to go to www.domain.com/folder was sent to the prestashop.

Any idea would be helpful.

Link to comment
Share on other sites

no, i do not want to enable any multistore inside prestashop.

what i want is to have independent microsites, each in their own folder, in the same domain where the prestashop is installed/hosted.

completely separate things, nothing to do with each other.

separate entities.

practically i want to install inside the same folder where prestashop is installed, another different website inside its own folder.

Link to comment
Share on other sites

Anyone guys?

This should be pretty easy for people that know how to do it.

I mean, after all, there is an admin folder inside the prestashop installation, and when you put that in your address bar, it goes very nicely there.

Maybe it is needed some modification in the main .htaccess and then another .htaccess inside the folder that i want to utilise for my microsite.

Link to comment
Share on other sites

On 10/21/2022 at 4:36 PM, texxo said:

Inside the prestashop installation, which is in the root folder of the domain, to create a folder, example: NEWPRODUCT, and to put inside html code from a micropage (for a particular product) - a landing page lets say.

This is not how any site works you can't open only folder and think any file in it will load automatically, in NEWPRODUCT folder you must add some file like index.html so full correct address will be www.domain.com/NEWPRODUCT/index.html

 

I think better way is create own module with custom address and load content in it.

Link to comment
Share on other sites

Hello and thanks for your answer but i think you do not understand what i want to do.

a) there is a prestashop installation in domain.com

b) i want to create a folder inside domain.com with name "example"

c) i want when someone types domain.com/example OR domain.com/example/ or domain.com/example/index.html to go and load the index.html file that is inside this folder "example"

d) like this i can create inside this folder a microsite - a landing page for 1 product (which i have already created but i use them with their own domains) that starts to load with index.html or index.php

e) so:

i) when someone types domain.com ----> loads normally the prestashop shop
ii) when someone types domain.com/example or domain.com/example/ or domain.com/example/index.html (or domain.com/example/index.php) to just load all the contents from the "example" folder.

f) i tried this in a localhost prestashop installation in the .htaccess file that prestashop has created:

blah blah blah blah blah

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on

#Domain: localhost/example      <--- added this
RewriteRule . - [E=REWRITEBASE:/example/index.html]     <--- added this

#Domain: localhost
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

 

It seems to work all ok in the localhost installation - do not know about if it will work all ok in live www installation.

If someone knows a bit more about these things, he could see, or suggest something better.

Link to comment
Share on other sites

ok, i am replying to myself here but just to show the progress so far.

Eventually it is NOT needed this additional RewriteRule that i added.

I tested on live installation and the "microsite" is working BUT there is a problem with the way how the folder is created inside the installation.

Meaning:

when i try for example localhost/EXAMPLE or localhost/Example or localhost/eXample it will not find it and basically it goes to the prestashop installation and i get a page not found error.

when i try with exactly how it is the folder name, e.g. "example", which means localhost/example then it loads perfectly the index.html and does what it is supposed to do.

So, the problem now is how can i make a proper rewrite rule that will take whatever case on the url with localhost/eXaMpLe and send it to the "example" folder.

Meaning how i can convert or instruct that the particular rewrite rule accepts any case and sends it always to the same folder.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...