Forums / Install & configuration / .htaccess file does allow access to my root

.htaccess file does allow access to my root

Author Message

Clay Pereira

Thursday 29 July 2004 10:09:40 am

Hi,

When i added the .httacces file I can't get access to my site by just typing the hostname.
I have to include /index.php. What redirect do I have have to add to make it so I don't have to add the index.php.

Something apears to be wrong with my <FilesMatch".">

<FilesMatch ".">
order allow,deny
deny from all
</FilesMatch>

<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html|swf)|var(.+)storage.pdf(.+)\.pdf)$">
order allow,deny
allow from all
</FilesMatch>

Jose Velez

Thursday 18 November 2004 7:06:01 pm

I am having the same problem. Does anyone know how to fix this?

Espen Pedersen

Monday 06 June 2005 9:29:55 am

I experience the same thing. Anyone cracked this one?

kracker (the)

Monday 06 June 2005 9:49:11 am

I <b>always</b> removed / commented those lines out, if I used the .htaccess file. I just never mentioned it before .. hrm.

//kracker

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Espen Pedersen

Monday 06 June 2005 11:52:40 am

Thanks for you answer kracker, I have removed:

</i><FilesMatch ".">
order allow,deny
deny from all
</FilesMatch></i>

And I've tried accessing f.ex. a ini file directly and it's not possible, so I guess this should be OK.

<b>But now I've got the trailing slash problem</b>, and yes I have tried Ekkehard's suggestions found in this thread: http://ez.no/community/forum/install_configuration/htaccess_hidden_at_last

<b>But it does not work :'(</b>

Espen Pedersen

Monday 06 June 2005 12:10:52 pm

Hmm .. think I have a workaround, it's not pretty but I think it does the job.

The trailing slash problem is caused by the rewrite rule. The .htaccess shown below will deny access to certain kind of filetypes, it's a bit vulnerable as you have to provide all the file extensions by hand ...

If someone provides a more robust solution for this I would be pleased :)

php_value allow_call_time_pass_reference 0

<FilesMatch "\.(txt|tp|tlp|cache|info|sql|ini|php|sh|pdf|log|LOG|tr|ttf|ts|xml|cpp)">
order allow,deny
deny from all
</FilesMatch>

<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf)$">
order allow,deny
allow from all
</FilesMatch>

RewriteEngine On
#RewriteRule !\.(gif|jpe?g|png|css|js|html)|var(.+)storage.pdf(.+)\.pdf$ index.php

DirectoryIndex index.php

kracker (the)

Monday 06 June 2005 2:14:37 pm

<b>*smacks his own forehead*</b>

What version of apache are you using with eZ publish.

I had the very same problem with eZ publish 3 (or greater) on Apache 2 in a couple of specific instances over the last year.

So I wrote up a report, not exactly sure just what's going on ...
http://ez.no/community/bugs/ezurloperator_php_incompatibility_with_apache2

I also posted to the sdk-public list:
http://lists.ez.no/pipermail/sdk-public/2005-May/001279.html
http://lists.ez.no/pipermail/sdk-public/2005-May/thread.html#1279

//kracker
<i>Aesop Rock : Labor Day : Save Yourself</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Espen Pedersen

Tuesday 07 June 2005 12:28:39 am

Here's my phpinfo() output

Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.11 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a

Thanks for the links, I'll read through them and see if it can help me :)

eZ debug

Timing: Jan 18 2025 10:24:26
Script start
Timing: Jan 18 2025 10:24:26
Module start 'content'
Timing: Jan 18 2025 10:24:27
Module end 'content'
Timing: Jan 18 2025 10:24:27
Script end

Main resources:

Total runtime0.7880 sec
Peak memory usage4,096.0000 KB
Database Queries213

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 587.9453180.8047
Module start 'content' 0.00810.6475 768.7500678.9688
Module end 'content' 0.65560.1323 1,447.7188340.4219
Script end 0.7879  1,788.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4853210.0002
Check MTime0.00140.1801210.0001
Mysql Total
Database connection0.00110.139410.0011
Mysqli_queries0.691887.79542130.0032
Looping result0.00230.29592110.0000
Template Total0.757796.220.3789
Template load0.00250.313820.0012
Template processing0.755295.838620.3776
Template load and register function0.00040.049510.0004
states
state_id_array0.00120.151010.0012
state_identifier_array0.00080.096320.0004
Override
Cache load0.00190.2436500.0000
Sytem overhead
Fetch class attribute can translate value0.00160.199650.0003
Fetch class attribute name0.00110.1398100.0001
XML
Image XML parsing0.00320.411850.0006
class_abstraction
Instantiating content class attribute0.00000.0040140.0000
General
dbfile0.00740.9411350.0002
String conversion0.00000.001030.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 38
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs