Opencart How To] Multi-Store on Xampp Localhost - xampp

Is there someone that has set up the Opencart multistore in their computer locally threw Xampp that would know how to add the code properly. I have gone threw as many tutorial as Google and this forum has and can't seem to figure out how to properly place the code. A sample of how it should look when placed in the http.conf file will
really help .
The tutorials is asking me to edit the Apache Configuration file add “alias” for each sub store.
Alias /opcStore_1 "C:/xampp/htdocs/store"
Alias /opcStore_2 "C:/xampp/htdocs/store"
go to this path: C:\xampp\apache\conf\
Find httppd.conf file and open it
Search ”” section and add below code inside this section. ???
Alias /opcStore_1 "C:/xampp/htdocs/store"
Alias /opcStore_2 "C:/xampp/htdocs/store"
HOW DOES IT LOOKS WHEN THE CODE IS ADDED? Where inside do I add it and how it should look?
Because I tried placing it but only get error local URL. Thanks
Now, you have to restart Apache server from your XAMPP control panel. After restarting, you have to add sub stores in Opencart configuration.
OpenCart configuration for Multi stores.
Logon to your main store : C:/xampp/htdocs/store/admin
Goto: System > Settings and here you can add new stores.
When adding give stores urls: for First store give url: "http://localhost/opcStore_1/"
for 2nd Store give url: "http://localhost/opcStore_2/"

Will look like this, at the end i have added 5 sub store.
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http:// localhost/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "cgi-bin/" Alias /allbridaljewelry "C:/wamp/www/newStore" Alias /caketopshop "C:/wamp/www/newStore"
Alias /myspecialparty "C:/wamp/www/newStore" Alias /superweddingday
"C:/wamp/www/newStore" Alias /weddingfavorsmart
"C:/wamp/www/newStore"

You could check this How to setup our own domain when in a developing stage (not localhost)/
It is in Indonesian, but you could try translate.google.com to translate this.
Hope it will be a help.

Let say your main store is http://localhost/opencart-1.5.6.1
Create your multistore (store name Malaysia) and the URL is http://localhost/opencart-1.5.6.1/malaysia/
Open file C:\xampp\apache\conf\httpd.conf and add this code Alias /opencart-1.5.6.1/malaysia "C:/xampp/htdocs/opencart-1.5.6.1/" code after ScriptAlias /cgi-bin/ "C:/xampp/cgi-bin/"
Restart Apache process and try to access this URL http://localhost/opencart-1.5.6.1/malaysia/

Related

Is it possible to get `www.mydomain.com/app` to point to `www.myapp.heroku.com`?

I have www.myapp.heroku.com and domain name www.mydomain.com.
Is it possible to have www.mydomain.com/app point to www.myapp.heroku.com?
Googling seems to only yield how to get www.mydomain.com to point to www.myapp.heroku.com. I can't find anything about forward slashes.
Try it with HTACCESS (If unknown create a blank file in your base directory and rename it to: .htaccess
Now add:
RewriteEngine on
Redirect /app http://www.app.yourdomain.com
Just tested it, will work (if your provider supports htaccess url forwarding)
Good Luck

How to disable location in nginx from bash command line?

Say I have a config in /etc/nginx/conf.d/myscript.conf
server {
listen 8080;
server_name _;
location = /a {...} # <-- needs to be disabled during maintainence
location = /b {...}
location = /c {...} # <-- needs to be enabled during maintainence
}
For maintainence I need to disable /a location, do some commands\deployments, then enable /a location back.
Can this be done automatically via bash, without programmatic config modifyings?
You can use includes and then just deal with creating and removing symlinks. Usually you see this done with server blocks (the base nginx.conf actually just includes conf.d/* which is how it loads your server blocks), but it can be done with anything. Basically you'll have two folders, named something like locations-available and locations-enabled, and put all of your location blocks in individual files in locations-available. In your server block include locations-enabled/* and then symlink all the locations you want enabled from locations-available to locations-enabled. Every time you add or remove symlinks just reload nginx and you should be good to go.
In you case just rm the symlink, reload, do whatever you want, recreate symlink, reload.

Rewrite everything to a single 'site down' page with Zeus Rewrite Rules

I'd like to make it so that any request for any file or page on my website gets directed to a single file: site_down.php
I know how to do this with apache rewrites but can't find a specific example for Zeus
match URL into $ with ^
if matched then
set URL = /site_down.php
endif

Zeus rewrite.script - multiple directories

Looking for a little help with Zeus Rewrite.Script for multiple directories - I have a working script that operates in I place Wordpress in a sub-directory - however, If I want to run another Wordpress installation in another directory I can't get the rewrite to work with this too. Any help would be greatly appreciated!
My rewrite for 1 directory;-
#Zeus webserver version of basic Wordpress mod_rewrite rules
map path into SCRATCH:path from %{URL}
look for file at %{SCRATCH:path}
if exists then goto END
look for dir at %{SCRATCH:path}
if exists then goto END
##### FIX FOR LOGIN/FORGOTTEN PASSWORD/ADMIN ETC #####
match URL into $ with ^/site1/wp-.*$
if matched then goto END
##### FIX TO ALLOW SEARCH TO WORK #####
match URL into $ with ^/oxford-walking-tours/(.*)
set URL = /site1/index.php/$1
So site1 in the first directory - can anyone suggest how I can make this work for site2 as well?
Thanks
The script below is one that may help all ZEUS server redirecting
It ignores the folder called myfolder (replace this with one you want to exclude from any redirect, you can still get to it.)
And the rest of the file redirects to the .com version of the website in www form (rule2) and without www (rule1).
Save the file as rewrite.script and upload to root directory of server.
#ignore anything to do with myfolder
match URL into $ with ^/myfolder(\/)?.*
if matched then goto END
RULE_1_START:
match IN:Host into $ with ^mywebsite\.net$
if matched then
match URL into $ with ^/(.*)$
if matched then
set OUT:Location = http://www.mywebsite.com/$1
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
endif
endif
RULE_1_END:
RULE_2_START:
match IN:Host into $ with ^www.\mywebsite\.net$
if matched then
match URL into $ with ^/(.*)$
if matched then
set OUT:Location = http://www.mywebsite.com/$1
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
endif
endif
RULE_2_END:

Help with mod_rewrite

I have my site under the structure: www.somesite.com/index.php?page=p_section_page.php
I want my site to display something like: www.somesite.com/section/page OR just www.somesite.com/page/
Tried to write rules in the .htaccess file like so:
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /
RewriteRule PAGE index.php?page=p_section_page.php
It works fine if i try www.somesite.com/page/ but the images, css files and js, try to access the www.somesite.com/page/css/ or www.somesite.com/images/ directories which clearly do not exist.
Any help here? Thanks!
My educated guess is that you are using relative paths. If you change the URL of the HTML document you change the effective path of pictures, scripts and other resources that are loaded via relative paths. It's the same as when you move the file to another directory.
I find it easier to call resources with absolute paths. You are using PHP so you have two options: hard-code the leading slash or use PHP to set it:
<img src="/images/picture.jpg" ... >
<img src="<?=$_SERVER['DOCUMENT_ROOT']?>images/picture.jpg" ... >

Resources