Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9092465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:51:07+00:00 2026-06-16T22:51:07+00:00

Hi I have a magento store at mysite.com Now I want to setup a

  • 0

Hi I have a magento store at mysite.com

Now I want to setup a url that will run my german website at mysite.com/german

Using the same install. I already have a half working config, but my issue is that beyond the homepage all magento URLs 404. Here is my current config.

server {

    listen 80;

    server_name mysite.com www.mysite.com;

    ####
    #
    #  BELOW THIS LINE IS MY ATTEMPT TO GET mysite.com/german to run from the same directory as mysite.com
    #
    ####


    location ~ /german(.*)\.php($|/) {
        fastcgi_pass 127.0.0.1:9000;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/share/nginx/www$1.php;
        fastcgi_param MAGE_RUN_CODE german;
        fastcgi_param MAGE_RUN_TYPE website;        
    }

    location ~ /german(.*) {
        index index.htm index.php;
        autoindex off;
        alias /usr/share/nginx/www$1;
    }

    location ~ /deutch/ {
        index index.htm index.php;
        try_files $uri $uri/ @handler;
    }

The old config:

    ###
    #
    # THIS BIT I THINK IS THE PART WHICH IS NOT QUITE WORKING, BUT I DON'T KNOW WHAT THE @handler PART DOES
    # 
    ###
    # This redirect is added so to use Magentos
    # common front handler when handling incoming URLs.
    location @handler {
        rewrite / /index.php;
    }

    ####
    #
    # BELOW THIS LINE IS THE ORIGINAL CONFIG WHICH RUNS mysite.com NO PROBLEMS
    #
    ####

    root /usr/share/nginx/www;

    location / {
        index index.htm index.php;
        try_files $uri $uri/ @handler;
    }

    # Deny access to specific directories no one
    # in particular needs access to anyways.
    location /app/ { deny all; }
    location /includes/ { deny all; }
    location /lib/ { deny all; }
    location /media/downloadable/ { deny all; }
    location /pkginfo/ { deny all; }
    location /report/config.xml { deny all; }
    location /var/ { deny all; }

    # Allow only those who have a login name and password
    # to view the export folder. Refer to /etc/nginx/htpassword.
    location /var/export/ {
        auth_basic "Restricted";
        auth_basic_user_file htpasswd;
        autoindex on;
    }

    # Deny all attempts to access hidden files
    # such as .htaccess, .htpasswd, etc...
    location ~ /\. {
         deny all;
         access_log off;
         log_not_found off;
    }

    # This redirect is added so to use Magentos
    # common front handler when handling incoming URLs.
    location @handler {
        rewrite / /index.php;
    }

    # Forward paths such as /js/index.php/x.js
    # to their relevant handler.
    location ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }

    # Handle the exectution of .php files.
    location ~ .php$ {
        if (!-e $request_filename) {
            rewrite / /index.php last;
        }
        expires off;
        fastcgi_pass 127.0.0.1:9000;
        #fastcgi_param HTTPS $fastcgi_https;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE english;
        fastcgi_param MAGE_RUN_TYPE website;
        include fastcgi_params;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:51:08+00:00Added an answer on June 16, 2026 at 10:51 pm
    location ~* \.php$ {
        if (!-e $request_filename) {
            rewrite / /index.php last;
        }
        expires off;
        set $runcode english;
        set $runtype website;
        if ( $request_uri ~* ^/german ) {
                set $runcode german;
        }
        fastcgi_pass 127.0.0.1:9000;
        #fastcgi_param HTTPS $fastcgi_https;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE $runcode;
        fastcgi_param MAGE_RUN_TYPE $runtype;
        include fastcgi_params;
    }
    

    That is part 1, part 2 is to ensure the code is run from the same codebase.
    One solution is to symlink the directory to the root directory, exec the following in the /usr/share/nginx/www directory:

    ln -s . ./german
    

    It’s filty, but it works 😉

    We’re using the following to redirect to the correct index file:

    location /german {
        if ( -e $request_filename ) {
            break;
        }
        rewrite ^/german(.*)$   /german/index.php last;
    }
        #
        #       Redirection of subdirectory php's to their respective php files
        #       
        location ~ .php/ {
            rewrite ^(.*.php)/ $1 last;
        }
        #
        #       Redirect everything else to root path
        #
        location / {
                try_files $uri $uri/ /index.php?$args;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

on my Magento site (not the real url ;) ), I have http://magento.local.com/media/ returning
I keep getting this Magento error emailed to myself: URL: http://mysite.com/sendfriend/product/send/id/1/ IP Address: 66.249.65.69
We have a Magento store setup and under version control, we'd like to setup
I have a magento website with multiple stores. I would like to setup CMS
I have a program that we use to connect our Magento store to our
I have a magento store that sells glasses, clothing etc. The problem is that
I have a few custom PHP functions for my Magento store that I stored
I have a multi-server single-store Magento setup as follows: n webservers behind a loadbalancer
I have this file from the theme of my Magento store: http://www.princessly.com/js/jquery/jquery-1.4.2.min.js And someone
I have a Tax-toggle button on every page of a Magento store, and want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.