Zen Cart Logo
Forums / All Other Contributions/Addons / Ceon URI Mapping v4.x

Ceon URI Mapping v4.x

Views: 452,022

Results 1,741 to 1,760 of 2,454
24 Nov 2014, 2:02 AM
#1741
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Ceon URI Mapping v4.x

lhungil:

Correct, one should not have multiple "alternative" URL modules installed. One could leave the Ultimate URLs .htaccess in place (before the CEON rules), but doing so will probably cause unneccessary redirects. As part of switching - One would want to enter the old (Ultimate) URLs into the CEON URI database.

Actually both Ultimate URLs and FEC can operate together. I've posted on this topic before and Diva is one of the contributors who helped narrow down the issue (caused by Numinix altering the default Zen Cart administrative configuration flow - and - Ultimate URLs depending on the stock Zen Cart administrative page for managing configuration options). They are not incompatible with the appropriate patches to the Numinex code installed.

Any further discussion on the topic of Ultimate URLs and Numinix modifications to the Zen Cart administrative configuration process does not belong in the CEON URI thread, but over at the Ultimate URLs (or FEC) support threads.
BOOM! But what the heck do I know since I've "obviously" never used these two together...

25 Nov 2014, 12:17 AM
#1742
chargin avatar

chargin

Zen Follower

Join Date:
Sep 2011
Posts:
136
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Hi all, Ive recently migrated a ZC site from one server to another using the transfer tool. Currently the site, after this transfer, cannot access the admin folder, or /blog. /blog/wp-admin does work though. /admin/login.php gives a blank page and /admin/ gives a 500.shtml error page not found.
What could I check here? The new server is using php 5.3 same as the old, ZC is 1.39h. Ive tried renaming the htaccess files in root and admin but with no success. It looks to me like CEON is the cause but cant say for sure. Perhaps theres a way to disable it via phpmyadmin?

25 Nov 2014, 5:14 AM
#1743
chargin avatar

chargin

Zen Follower

Join Date:
Sep 2011
Posts:
136
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Chargin:

Hi all, Ive recently migrated a ZC site from one server to another using the transfer tool. Currently the site, after this transfer, cannot access the admin folder, or /blog. /blog/wp-admin does work though. /admin/login.php gives a blank page and /admin/ gives a 500.shtml error page not found.
What could I check here? The new server is using php 5.3 same as the old, ZC is 1.39h. Ive tried renaming the htaccess files in root and admin but with no success. It looks to me like CEON is the cause but cant say for sure. Perhaps theres a way to disable it via phpmyadmin?

Well its all fixed, turns out it was php being at 5.3 and zend was not enabled. Nothing to do with CEON!

3 Dec 2014, 1:18 PM
#1744
panservolvo avatar

panservolvo

New Zenner

Join Date:
Sep 2010
Posts:
38
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

First of all, I have had this module installed for several years, so my server host does have the required specifications.
Now I have created a fresh install of zc 153 and I am trying to install this module again.
I have uploaded all the files. When I try to log into admin I get a blank page 500, error.
If I upload all the backup files the same error occurs.
If I delete all the CEON- files in admin and upload the backup files, I am able to log in to admin again.

Any suggestions to what may be the problem?

ps: I can't link to the page with the problem because its a live environment so I had to delete the module to be able to use admin.

3 Dec 2014, 2:40 PM
#1745
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

panservolvo:

First of all, I have had this module installed for several years, so my server host does have the required specifications.
Now I have created a fresh install of zc 153 and I am trying to install this module again.
I have uploaded all the files. When I try to log into admin I get a blank page 500, error.
If I upload all the backup files the same error occurs.
If I delete all the CEON- files in admin and upload the backup files, I am able to log in to admin again.

Any suggestions to what may be the problem?

ps: I can't link to the page with the problem because its a live environment so I had to delete the module to be able to use admin.

Is the admiin folder the same now as it was/covered in your .htaccess file? How did you do your upgrade, etc...(Fom the posting guidelines.)

3 Dec 2014, 4:21 PM
#1746
panservolvo avatar

panservolvo

New Zenner

Join Date:
Sep 2010
Posts:
38
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

mc12345678:

Is the admiin folder the same now as it was/covered in your .htaccess file? How did you do your upgrade, etc...(Fom the posting guidelines.)

admin folder has the same name as the old folder had.
I did not upgrade, I ran a complete new install of 153.
The .htaccess is from the old 150 istallation though.

here is the rewrite part from the .htaccess

# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/MyAdminFolder [NC]
3 Dec 2014, 4:43 PM
#1747
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Ceon URI Mapping v4.x

panservolvo:

ps: I can't link to the page with the problem because its a live environment so I had to delete the module to be able to use admin.
Two things..

  1. NEVER upgrade your live site.. ALWAYS ALWAYS create a development site which is a clone of your live site (the recommended upgrade path)
  2. Not sure what HARM you think will come from posting the site URL, but it will certainly assist the community in helping you with your issue. If you are concerned about the search engines picking it up, then OBSCURE the URL.. (e.g. http://yoursite(dot)com)

panservolvo:

admin folder has the same name as the old folder had.
I did not upgrade, I ran a complete new install of 153.
The .htaccess is from the old 150 istallation though.

here is the rewrite part from the .htaccess

Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])

RewriteCond %{REQUEST_URI} !.[a-z]{2,5}$ [NC]

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/MyAdminFolder [NC]


Post the WHOLE file contents please.. it will speed things along here so folks won't have to keep lobbing guesses at you..
3 Dec 2014, 4:55 PM
#1748
panservolvo avatar

panservolvo

New Zenner

Join Date:
Sep 2010
Posts:
38
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

1: I did not upgrade a live site, i had a dev site which I now have live
2: no harm in posting the site url, but as I said I have rolled back to my backup to have a working admin. In other words, no CEON URI and no error now
3:

#
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 18695 2011-05-04 05:24:19Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified. 
# Example:
#<Directory "/usr/local/apache/htdocs">
#  AllowOverride Limit Options Indexes
#</Directory>
###############################


##ROOT##

ExpiresActive On
ExpiresByType text/css "access plus 500 days"
ExpiresByType application/javascript "access plus 500 days"

<Files stylesheet.css>
ExpiresByType text/css "access plus 350 days"
</Files>

 <FilesMatch \.(swf)$>
  ExpiresDefault "access plus 700 days"
 </FilesMatch>

 <FilesMatch \.(svg)$>
  ExpiresDefault "access plus 3000 days"
 </FilesMatch>

ExpiresByType image/gif "access plus 1500 days"

ExpiresByType image/jpg "access plus 1500 days"

ExpiresByType image/jpeg "access plus 1500 days"

ExpiresByType image/png "access plus 1500 days"

ExpiresByType image/bmp "access plus 1500 days"

# 48 weeks
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|JPG|woff)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>

<files *>
order allow,deny
deny from 80.212.29.94
deny from 74.50.57.39
deny from 24.189.60.120
deny from 84.17.15.2
deny from 211.167.110.2
deny from 91.201.64.26
deny from 65.208.189
deny from 65.211.195
#deny from 195.1.61
allow from all
</files>

RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^madasahatter.no$ [NC]
RewriteRule ^(.*)$ http://madasahatter.no/$1 [L,R=301] 


# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/MyAdminFolder [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors [NC]
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel [NC]
RewriteCond %{REQUEST_URI} !/frontend [NC]
# Don't rewrite ajax directory
RewriteCond %{REQUEST_URI} !^/ajax/ [NC]
# Don't rewrite bmz_cache directory
RewriteCond %{REQUEST_URI} !^/bmz_cache/ [NC]
# Handle all other URIs using Zen Cart (index.php)
# RewriteRule .* index.php?%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} ^maah.no$ [OR]
RewriteCond %{HTTP_HOST} ^www.maah.no$
RewriteRule ^/?$ "http\:\/\/madasahatter\.no\/" [R=301,L]
3 Dec 2014, 5:30 PM
#1749
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

panservolvo:

1: I did not upgrade a live site, i had a dev site which I now have live
2: no harm in posting the site url, but as I said I have rolled back to my backup to have a working admin. In other words, no CEON URI and no error now
3:

@copyright Copyright 2003-2010 Zen Cart Development Team

@license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

@version $Id: .htaccess 18695 2011-05-04 05:24:19Z drbyte $

This is used with Apache WebServers

The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions

It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.

Will also prevent people from seeing what is in the dir. and any sub-directories

For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.

Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.

Example:

#<Directory "/usr/local/apache/htdocs">

AllowOverride Limit Options Indexes

#</Directory>
###############################

##ROOT##

ExpiresActive On
ExpiresByType text/css "access plus 500 days"
ExpiresByType application/javascript "access plus 500 days"

<Files stylesheet.css> ExpiresByType text/css "access plus 350 days" </Files>

<FilesMatch .(swf)$>
ExpiresDefault "access plus 700 days"
</FilesMatch>

<FilesMatch .(svg)$>
ExpiresDefault "access plus 3000 days"
</FilesMatch>

ExpiresByType image/gif "access plus 1500 days"

ExpiresByType image/jpg "access plus 1500 days"

ExpiresByType image/jpeg "access plus 1500 days"

ExpiresByType image/png "access plus 1500 days"

ExpiresByType image/bmp "access plus 1500 days"

48 weeks

<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|swf|JPG|woff)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>

<files *>
order allow,deny
deny from 80.212.29.94
deny from 74.50.57.39
deny from 24.189.60.120
deny from 84.17.15.2
deny from 211.167.110.2
deny from 91.201.64.26
deny from 65.208.189
deny from 65.211.195
#deny from 195.1.61
allow from all
</files>

RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^madasahatter.no$ [NC]
RewriteRule ^(.*)$ http://madasahatter.no/$1 [L,R=301]

Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])

RewriteCond %{REQUEST_URI} !.[a-z]{2,5}$ [NC]

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/MyAdminFolder [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors [NC]

Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel [NC]
RewriteCond %{REQUEST_URI} !/frontend [NC]

Don't rewrite ajax directory

RewriteCond %{REQUEST_URI} !^/ajax/ [NC]

Don't rewrite bmz_cache directory

RewriteCond %{REQUEST_URI} !^/bmz_cache/ [NC]

Handle all other URIs using Zen Cart (index.php)

RewriteRule .* index.php?%{QUERY_STRING} [L]

RewriteCond %{HTTP_HOST} ^maah.no$ [OR]
RewriteCond %{HTTP_HOST} ^www.maah.no$
RewriteRule ^/?$ "http://madasahatter.no/" [R=301,L]


And this is working on the live site? Almost wonder how, all server references are rewritten to not be maah.no therefore it appears that the CEON rewriterule is never respected...

Also, by having two versions of the site, are they both on the same host? Is the .htaccess above in some way conflicting with another rule, or the setup?

Fyi, I thought the reason not to post the "link" wasbecause the problem appeared in the admin and didn't want to post the admin path which is appropriate not to post... Certainly might be able to gain some insight into the store side from having the information (which is now provided it would seem.)
3 Dec 2014, 6:29 PM
#1750
panservolvo avatar

panservolvo

New Zenner

Join Date:
Sep 2010
Posts:
38
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

the maah-part is there because the maah.no is just a "shortcut" to madasahatter.no if you type maah.no you instantly get redirected to madasahatter.no
this is set up in cpanel.

the admin-folder is not the same as in the htaccess i posted over, I changed the name for security reasons

3 Dec 2014, 6:37 PM
#1751
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

panservolvo:

the maah-part is there because the maah.no is just a "shortcut" to madasahatter.no if you type maah.no you instantly get redirected to madasahatter.no
this is set up in cpanel.

the admin-folder is not the same as in the htaccess i posted over, I changed the name for security reasons

Understood about the rename of the admin folder in the .htaccess (appropriate action for posting it) andunderstood that the maah.no uri gets rewritten before the ceon rewrite, but a problem is that the ceon rewrite expects the uri to contain either of the two hosts that contain maah in them. At the point this portion of the .htaccess is performed the host name should have already been rewritten and therefore the ceon rewrite never successfully rewrites if I am correct.

3 Dec 2014, 6:45 PM
#1752
panservolvo avatar

panservolvo

New Zenner

Join Date:
Sep 2010
Posts:
38
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I dont quite get what you're saing.
If I type madasahatter.no/myAdmin the ceon will never "see" the maah-domain, and htaccess is saying dont rewrite /myAdmin.
the maah is strictly for use as a shortcut name, nothing else

3 Dec 2014, 7:22 PM
#1753
panservolvo avatar

panservolvo

New Zenner

Join Date:
Sep 2010
Posts:
38
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I found out what was causing the error.. Besides myself...
I had forgotten to change from the dev environtment path in the admin/includes/configuration.php

3 Dec 2014, 8:13 PM
#1754
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

What I'm saying is that for the arrangement that you have, the .htaccess should look like below.

Reason: between rewriteconds each rewriterule is evaluated. If a rewriterule is false, then the rewritecond is not performed. Because yours has/had a check for the host_name being maah.no, then that evaluates as false every time because of the previous rewrite to make all http_host values to be madasahatter. Therefore the rewritecond never executes. In the case of trying to access the admin directory and although that issue was for another reason, the rewritecond is also not met and not performed whiich is by design. Assuming that there is no data currently to perform the rewrite (brand new install without transferring the previous database that had this plugin installed) then the issue would not have been identified until the first rewrite was entered/tested.

I'm somewhat assuming though that you did rebuild your site using your previous database and unless you disabled this plugin before upgrading the ceon tables are still present and technically the rewrites should be happening now as we speak (provided that the .htaccess directs the rewrite).

#
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 18695 2011-05-04 05:24:19Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified. 
# Example:
#<Directory "/usr/local/apache/htdocs">
#  AllowOverride Limit Options Indexes
#</Directory>
###############################


##ROOT##

ExpiresActive On
ExpiresByType text/css "access plus 500 days"
ExpiresByType application/javascript "access plus 500 days"

<Files stylesheet.css>
ExpiresByType text/css "access plus 350 days"
</Files>

 <FilesMatch \.(swf)$>
  ExpiresDefault "access plus 700 days"
 </FilesMatch>

 <FilesMatch \.(svg)$>
  ExpiresDefault "access plus 3000 days"
 </FilesMatch>

ExpiresByType image/gif "access plus 1500 days"

ExpiresByType image/jpg "access plus 1500 days"

ExpiresByType image/jpeg "access plus 1500 days"

ExpiresByType image/png "access plus 1500 days"

ExpiresByType image/bmp "access plus 1500 days"

# 48 weeks
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|JPG|woff)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>

<files *>
order allow,deny
deny from 80.212.29.94
deny from 74.50.57.39
deny from 24.189.60.120
deny from 84.17.15.2
deny from 211.167.110.2
deny from 91.201.64.26
deny from 65.208.189
deny from 65.211.195
#deny from 195.1.61
allow from all
</files>

RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^madasahatter.no$ [NC]
RewriteRule ^(.*)$ http://madasahatter.no/$1 [L,R=301] 


# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/MyAdminFolder [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors [NC]
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel [NC]
RewriteCond %{REQUEST_URI} !/frontend [NC]
# Don't rewrite ajax directory
RewriteCond %{REQUEST_URI} !^/ajax/ [NC]
# Don't rewrite bmz_cache directory
RewriteCond %{REQUEST_URI} !^/bmz_cache/ [NC]
# Handle all other URIs using Zen Cart (index.php)
# RewriteRule .* index.php?%{QUERY_STRING} [L]
RewriteRule ^/?$ "http\:\/\/madasahatter\.no\/" [R=301,L]
3 Dec 2014, 8:39 PM
#1755
panservolvo avatar

panservolvo

New Zenner

Join Date:
Sep 2010
Posts:
38
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Thanks for helping out. Your rewrite part didnt work, probably because of the # before the .* index.php?

I have changed my rewrite part to this and its working.
Any comments?

RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^madasahatter.no$ [NC]
RewriteRule ^(.*)$ http://madasahatter.no/$1 [L,R=301] 


## BEGIN CEON URI MAPPING REWRITE RULE

# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
#   which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
# Don't rewrite any URIs for some specific file format extensions,
#   which are not covered by main file extension condition above
#   Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
#RewriteCond %{REQUEST_URI} !\.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/SuperSecretAdminPath [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors/ [NC]
# Don't rewrite logs directory
RewriteCond %{REQUEST_URI} !^/logs/ [NC]
# Don't rewrite bmz_cache directory
RewriteCond %{REQUEST_URI} !^/bmz_cache/ [NC]
# Don't rewrite min directory
RewriteCond %{REQUEST_URI} !^/min/ [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule .* index.php [QSA,L]
3 Dec 2014, 8:47 PM
#1756
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

First is that in many places I had the wrong statement (corrected below in red).

mc12345678:

What I'm saying is that for the arrangement that you have, the .htaccess should look like below.

Reason: between rewriterules each rewritecond is evaluated. If a rewritecond is false, then the rewriterule is not performed. Because yours has/had a check for the host_name being maah.no, then that evaluates as false every time because of the previous rewrite to make all http_host values to be madasahatter. Therefore the rewriterule never executes. In the case of trying to access the admin directory and although that issue was for another reason, the rewritecond is also not met and not performed which is by design. Assuming that there is no data currently to perform the rewrite (brand new install without transferring the previous database that had this plugin installed) then the issue would not have been identified until the first rewrite was entered/tested.

I'm somewhat assuming though that you did rebuild your site using your previous database and unless you disabled this plugin before upgrading the ceon tables are still present and technically the rewrites should be happening now as we speak (provided that the .htaccess directs the rewrite).

@copyright Copyright 2003-2010 Zen Cart Development Team

@license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

@version $Id: .htaccess 18695 2011-05-04 05:24:19Z drbyte $

This is used with Apache WebServers

The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions

It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.

Will also prevent people from seeing what is in the dir. and any sub-directories

For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.

Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.

Example:

#<Directory "/usr/local/apache/htdocs">

AllowOverride Limit Options Indexes

#</Directory>
###############################

##ROOT##

ExpiresActive On
ExpiresByType text/css "access plus 500 days"
ExpiresByType application/javascript "access plus 500 days"

<Files stylesheet.css> ExpiresByType text/css "access plus 350 days" </Files>

<FilesMatch .(swf)$>
ExpiresDefault "access plus 700 days"
</FilesMatch>

<FilesMatch .(svg)$>
ExpiresDefault "access plus 3000 days"
</FilesMatch>

ExpiresByType image/gif "access plus 1500 days"

ExpiresByType image/jpg "access plus 1500 days"

ExpiresByType image/jpeg "access plus 1500 days"

ExpiresByType image/png "access plus 1500 days"

ExpiresByType image/bmp "access plus 1500 days"

48 weeks

<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|swf|JPG|woff)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>

<files *>
order allow,deny
deny from 80.212.29.94
deny from 74.50.57.39
deny from 24.189.60.120
deny from 84.17.15.2
deny from 211.167.110.2
deny from 91.201.64.26
deny from 65.208.189
deny from 65.211.195
#deny from 195.1.61
allow from all
</files>

RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^madasahatter.no$ [NC]
RewriteRule ^(.*)$ http://madasahatter.no/$1 [L,R=301]

Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])

RewriteCond %{REQUEST_URI} !.[a-z]{2,5}$ [NC]

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/MyAdminFolder [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors [NC]

Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel [NC]
RewriteCond %{REQUEST_URI} !/frontend [NC]

Don't rewrite ajax directory

RewriteCond %{REQUEST_URI} !^/ajax/ [NC]

Don't rewrite bmz_cache directory

RewriteCond %{REQUEST_URI} !^/bmz_cache/ [NC]

Handle all other URIs using Zen Cart (index.php)

RewriteRule .* index.php?%{QUERY_STRING} [L]

RewriteRule ^/?$ "http://madasahatter.no/" [R=301,L]


> **panservolvo:**
>
> Thanks for helping out. Your rewrite part didnt work, probably because of the # before the .* index.php? 
> 
> I have changed my rewrite part to this and its working.
> Any comments?
> 
> ```
RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^madasahatter.no$ [NC]
RewriteRule ^(.*)$ http://madasahatter.no/$1 [L,R=301] 


## BEGIN CEON URI MAPPING REWRITE RULE

# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
#   which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
# Don't rewrite any URIs for some specific file format extensions,
#   which are not covered by main file extension condition above
#   Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
#RewriteCond %{REQUEST_URI} !\.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/SuperSecretAdminPath [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors/ [NC]
# Don't rewrite logs directory
RewriteCond %{REQUEST_URI} !^/logs/ [NC]
# Don't rewrite bmz_cache directory
RewriteCond %{REQUEST_URI} !^/bmz_cache/ [NC]
# Don't rewrite min directory
RewriteCond %{REQUEST_URI} !^/min/ [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule .* index.php [QSA,L]

As to the above new rewrite rule, I do not currently have an answer as I am unable to review an existing functional version to determine if the .htaccess conditions and rules are correct. Suggest though using the admin tool to autogenerate the htaccess rules to validate.

3 Dec 2014, 9:24 PM
#1757
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ceon URI Mapping v4.x

panservolvo:

Thanks for helping out. ... I have changed my rewrite part to this and its working. ...
I would recommend removing the directive "RewriteBase /" (not needed, just increases processing time).

If after removing the other directives from the .htaccess file (like the example) everything works, most likely the new hosting provider does not support one those removed directives. When a directive is found in a .htaccess file and has been disabled or disallowed by the server configuration, it often results in a HTTP 500. There should be records in the server's error log indicating the cause of the HTTP 500.

16 Dec 2014, 2:56 PM
#1758
dp_web avatar

dp_web

New Zenner

Join Date:
Jan 2009
Posts:
25
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Hi, we are using this module on a site that is also using a Google Sitemap XML file generator plugin.

Our output file is only giving us the old, standard Zen Cart product ID URL - which Google really doesn't like inside XML sitemaps as it requires a 200 response header rather than a 301.

The documentation states that the module deals with this and how to set it up, but the output is only ever the same, with the original URL.

Is there anyway to pull the new URL out (generated by CEON module) and input it into the Sitemap XML file? The info should be inside the database somewhere...

Cheers,
dp

16 Dec 2014, 3:05 PM
#1759
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

dp-web:

Hi, we are using this module on a site that is also using a Google Sitemap XML file generator plugin.

Our output file is only giving us the old, standard Zen Cart product ID URL - which Google really doesn't like inside XML sitemaps as it requires a 200 response header rather than a 301.

The documentation states that the module deals with this and how to set it up, but the output is only ever the same, with the original URL.

Is there anyway to pull the new URL out (generated by CEON module) and input it into the Sitemap XML file? The info should be inside the database somewhere...

Cheers,
dp

Verify your installation of both products, as we are using the same and have no issues... XML files reflect the rewritten URLs. Also, helps to identify the version(s) of the software, but this may be something to address in the Google Sitemap XML thread as it seems that it is what is not working correctly, or on a separate thread as these two products work together when the applicable files are properly merged/installed. (Successfully working on ZC 1.5.1 and expect no different on ZC 1.5.3)

16 Dec 2014, 3:25 PM
#1760
dp_web avatar

dp_web

New Zenner

Join Date:
Jan 2009
Posts:
25
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

mc12345678:

Verify your installation of both products, as we are using the same and have no issues... XML files reflect the rewritten URLs. Also, helps to identify the version(s) of the software, but this may be something to address in the Google Sitemap XML thread as it seems that it is what is not working correctly, or on a separate thread as these two products work together when the applicable files are properly merged/installed. (Successfully working on ZC 1.5.1 and expect no different on ZC 1.5.3)

Hi, we're running on Zen Cart v1.5.1. Our Ceon version is v4.4.1. Our Sitemap is called Sitemap XML and is v3.2.12 19.09.2013.

Your confirmation that both of these modules work together and output as needed is good, and it really is an installation issue somewhere along the line.

Cheers,
dp