Magento Forum

Page 5 of 5
htaccess for magento in subdirectory
 
mk384
Member
 
Total Posts:  60
Joined:  2010-05-21
 

Hello

I am hoping someone will help me on this,

Reason why I am posting here is because it is similar issue I think.

I have been having total nightmare getting multi store to work.

I have spent alot of time going through alot of posts and tutorials.

my magento primary or main installtion is in a subfolder or my main domain

http://www.xyz.co.uk/magento

I have created a new store in a sub folder

http://www.xyz.co.uk/magento/store1

Having finally managed to get something to load, I not have a problem that when I visit

http://www.xyz.co.uk/magento/store1

There is no theme template css etc just white background with all the links for that store, including all the categories for that store
please see attachment. plus it takes very long time to load this new store1 the main install loads quickly.

I have another index.php and htaccess in my main domain which is another cart, so I can not move my Magento Main install index.php and httaccess into the public html folder as it will overwrite.

I am really strugling to understand why this is happening but having read this post, it may be due my main install being in subfolder that is causing the issue.

Please can anyone help on this.

Regards

Image Attachments
newstore.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
kanted
Jr. Member
 
Total Posts:  12
Joined:  2008-09-20
 

Thanks Ontic, I had a working installation under saco.in/magento whihc i wanted to make ti saco.in .I followed the instructions and now when I go to saco.in it takes me to magneto down loader page struck with ti for four days could any one please help

 
Magento Community Magento Community
Magento Community
Magento Community
 
matteoweb
Member
 
Total Posts:  55
Joined:  2008-07-14
 

Easy!

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /shop/index.php [L]
</IfModule>

...where shop is a subdir.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Chrisop
Member
 
Total Posts:  33
Joined:  2010-08-11
 
matteoweb - 06 July 2012 03:52 AM

Easy!

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /shop/index.php [L]
</IfModule>

...where shop is a subdir.

Hi there,

Im having the same problem, Where do i put the above code?

thanks heaps

 
Magento Community Magento Community
Magento Community
Magento Community
 
husseycoding
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2010-06-18
UK
 

An old thread I know, but I’ve written a blog post here about how to get Magento running in a subdirectory and be seamlessly rewritten so as not to include the subdirectory in the URL.  One rewrite rule and one line added to index.php is all you need.

 
Magento Community Magento Community
Magento Community
Magento Community
 
markdh1
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2012-06-29
U.S. Georgia
 
ontic - 22 December 2010 12:55 PM

Here’s what I typically do when installing Magento inside a subdirectory.

Givens (Substitute as necessary)

a. /public_html/ is your root web directory
b. /public_html/magento/ is the directory where Magento will be installed
c. http://www.domain.com is the domain name which points to your root directory

Steps

1. Extract the Magento files to your /public_html/magento/ directory
2. Navigate to http://www.domain.com/magento and install Magento as normal (Don’t change the Base URL during installation)
3. After installing Magento, log into the backend and disable all cache (Don’t log out, you will need to change some settings later)
4. Copy /public_html/magento/.htaccess to /public_html/.htaccess
5. Copy /public_html/magento/index.php to /public_html/index.php
6. Edit /public_html/index.php and make the changes listed below.

Line 40$compilerConfig 'magento/includes/config.php';
Line 45$mageFilename 'magento/app/Mage.php';
Line 46$maintenanceFile 'magento/maintenance.flag';
Line 49: if (is_dir('magento/downloader'))
Line 50header("Location: magento/downloader");
Line 58: include_once dirname(__FILE__) . '/magento/errors/503.php';

7. Navigate to System->Configuration->Web and change your Unsecure and Secure settings to what’s shown below

Base URLhttp://www.domain.com/
Base Link URL{{unsecure_base_url}}
Base Skin URL
{{unsecure_base_url}}magento/skin/
Base Media URL{{unsecure_base_url}}magento/media/
Base JavaScript URL{{unsecure_base_url}}magento/js/

Base URLhttp://www.domain.com/
Base Link URL{{secure_base_url}}
Base Skin URL
{{secure_base_url}}magento/skin/
Base Media URL{{secure_base_url}}magento/media/
Base JavaScript URL{{secure_base_url}}magento/js/

8. As a work around for not being able to access the Magento Connect Manager. Add the line below to your /public_html/.htaccess file.

#RewriteBase /magento/
RedirectMatch ^/downloader/(.*) /magento/downloader/$1

9. Save the changes and your done.

This. Nice. Clean. Works like a charm! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 5 of 5