Do you think its okay to just leave it like that and access the admin page through
admin/login.php ?
Thanks for the help.
Printable View
Do you think its okay to just leave it like that and access the admin page through
admin/login.php ?
Thanks for the help.
Hi,
That sounds like a working alternative solution.. why not then? :)
All the best..
Conor
ceon
It seems like I figured it out.
I used the below htaccess file.
RewriteEngine On
# ONLY rewrite URIs beginning with /store/
RewriteCond %{REQUEST_URI} ^/store/.* [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxx])
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/store/adminmy.* [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/store/editors.* [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/forums.* [NC]
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]
# Handle all other URIs using Zen Cart (index.php)
RewriteRule (.*) /store/index.php?%{QUERY_STRING} [L]
Thanks alot for this module. I will enjoy using it.
Hi,
Ah, I see you mixed up your rewrite rules, using the one for the root folder when you should have been using the one for the store folder.
Glad you like it! Thanks for letting us know what you'd done wrong.. I couldn't see what else to suggest based on what you'd posted and am glad it is all working now!
All the best..
Conor
ceon
Hi,
I actually moved the htaccess to the root folder after it did not work and rewrote the htaccess file to have the store folder.
It somehow resolved it but definately was not because of wrong location.
Thanks for the help!
Charles
Hi Charles,
It wasn't the location but the content of the .htaccess file that was the problem.. as your store was in a subdirectory, it needed to use the rule for a subdirectory, whereas you'd been using the rule for a store with no subdirectory. Once you used the right rule things started to work! :)
No problem!
All the best...
Conor
ceon
Hi ceon,
I really like your mod. I had some issues with my site and had to modify the .htaccess files and now I can't get back into my admin. I have 2 .htaccess files. One in the root directory (to redirect to the store) and one in the store directory. Here they are:
Root:
Store:Code:Options +FollowSymLinks
RewriteEngine on
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !/zencart/admin.* [NC]
RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]
RewriteRule ^(.*) http://www.games4gamersonline.com/zencart/$1 [R=301,L]
What do I need to do to fix this? Admin keeps redirecting to the home page? Thanks for any help.Code:# ONLY rewrite URIs beginning with /zencart/
RewriteCond %{REQUEST_URI} ^/zencart/.* [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxx])
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/zencart/admin.* [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/zencart/editors.* [NC]
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]
# Handle all other URIs using Zen Cart (index.php)
RewriteRule (.*) index.php?%{QUERY_STRING} [L]
In ALL of the RewriteCond patterns, remove the unwanted trailing .* part of the pattern where you are not capturing it in a backreference.
Change the reference to 'admin' to reflect what your admin folder is actually called.
Beware of paths that are localised when used with RewriteRule when the .htaccess is in a folder.
You have your store in a subdirectory and are using a redirect so that when folks hit your main domain they are redirected to the sub-directory??? Why do you have Zen Cart setup in this manner?? You could solve a LOT of your issues by moving Zen Cart into your site root and NOT use a sub directory at all..
Hello,
Will this module work for an addon domain? Im getting HTTP 404 Not Found when im using exactly the same .htaccess as the main domain.
Thanks