Forums / Install & configuration / Exclude certain URIs from rewrite rule

Exclude certain URIs from rewrite rule

Author Message

James Ward

Monday 26 May 2003 6:27:19 pm

I currently have a virtual host setup configured and working fine. My problem is that my server was initialy setup to allow statistics and webmail access to users via the urls www.example.com/stats and www.example.com/webmail.

With the rewrite rule given in the eZ manual these urls are just interpreted as incorrect ez publish modules. Is there anyway to exclude certain urls from the rewrite rule?

working at www.wardnet.com
blogging at www.jamesward.ca

Paul Borgermans

Tuesday 27 May 2003 6:24:18 am

This should do the trick (I suppose a trailing slash and more will make up the real-life urls)

RewriteRule !(^/stats/.*$|^/webmail/.*$|\.(gif|css|jpg|png|js|asf|avi|wmv|swf|xsl|jar))$ /<your path to>/index.php

You will need to avoid the words stats and webmail as first level nodes in your site when using url_alias (nice urls).

hth

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

James Ward

Tuesday 27 May 2003 10:09:14 am

Thanks Paul,
This worked like a charm for the "stats" page but the "webmail" page still comes up with:
Module not found
The requested module 'openwebmail-cgi' could not be found.
The page title changes to "Open Webmail" which is correct but the error is all thats displayed. Any thoughts?

working at www.wardnet.com
blogging at www.jamesward.ca

Jonny Bergkvist

Wednesday 28 May 2003 12:38:31 am

If openwebmail.cgi is in located your /cgi-bin/-folder, then I think you should also try to exclude this folder in the RewriteRule.

James Ward

Thursday 29 May 2003 12:00:35 am

I tried excluding cgi-bin and openwebmail-cgi but I still received the same error message. I believe the problem is the fact that webmail is not an actual folder in my web directory. Another possible problem is the fact that openwebmail appears to use frames. Here is the source from my error loading module page:
<HTML>
<HEAD><TITLE>Open WebMail</TITLE></HEAD>
<FRAMESET rows=100%,* border=0 frameborder=0 framespacing=0 framecolor=#000000>
<FRAME SRC=/openwebmail-cgi/openwebmail.pl>
<FRAME SRC=white.html>
</FRAMESET>
</HTML>

Certainly not what I expected, but it does explain why the title changed. Any other suggestions?

working at www.wardnet.com
blogging at www.jamesward.ca

James Ward

Thursday 29 May 2003 12:16:25 am

O.K. I'm a little closer. I added ^/openwebmail-cgi/openwebmail.pl.*$ to my rewrite rule. Now when I add webmail to the url I am prompted with my openwebmail login screen. Unforunately, if I type in the correct user name and password I get the same error page:
Module not found
The requested module 'openwebmail-cgi' could not be found.

If I enter an incorrect user name and password everything works fine, it tells me it wrong and asks me to try again.

There must be another .pl file I need to include in my rewrite rule.

working at www.wardnet.com
blogging at www.jamesward.ca

Paul Borgermans

Thursday 29 May 2003 1:47:45 pm

Yes, but like this it may become a bit too hard for the simple solution I mentioned.

I would advise you to read slowly the rewrite (mod_rewrite) docs for apache. A lot can be done, but mod_rewrite is not that obvious. Try adding a set of rewrite rules before the one for ez publish and terminate the last one with [L]. With some luck you may have the entire cgi path work without interference from index.php of ezp rather fast. I'm not an apache mod_rewrite expert,so can't help you more on this now. Sorry.

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

eZ debug

Timing: Jan 18 2025 16:19:05
Script start
Timing: Jan 18 2025 16:19:05
Module start 'content'
Timing: Jan 18 2025 16:19:05
Module end 'content'
Timing: Jan 18 2025 16:19:06
Script end

Main resources:

Total runtime0.7291 sec
Peak memory usage4,096.0000 KB
Database Queries208

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.8516180.8203
Module start 'content' 0.00640.5795 768.6719636.6172
Module end 'content' 0.58590.1432 1,405.2891341.0625
Script end 0.7291  1,746.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.6253210.0002
Check MTime0.00160.2139210.0001
Mysql Total
Database connection0.00070.101310.0007
Mysqli_queries0.638787.59392080.0031
Looping result0.00210.29402060.0000
Template Total0.703096.420.3515
Template load0.00220.299520.0011
Template processing0.700896.119220.3504
Template load and register function0.00010.014810.0001
states
state_id_array0.00100.143710.0010
state_identifier_array0.00150.201220.0007
Override
Cache load0.00190.2643460.0000
Sytem overhead
Fetch class attribute can translate value0.00190.261840.0005
Fetch class attribute name0.00170.2288100.0002
XML
Image XML parsing0.00170.227940.0004
class_abstraction
Instantiating content class attribute0.00000.0042140.0000
General
dbfile0.00260.3586400.0001
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs