Forums / Install & configuration / .htaccess vs Vhosts.conf for nice URLS

.htaccess vs Vhosts.conf for nice URLS

Author Message

Iain MacLean

Sunday 22 February 2004 1:37:36 pm

Hello

Like many people, I've struggled with getting the ezroot operator to work using the Rewrite rule in .htaccess to create nice URLs. I have followed all the suggestions I have found in the documentation and the forums on how to use the Rewrite rules in .htaccess, to no avail.

I have changed the links in the templates as described in the "Creating nice URLs" documentation page, and inserted the recommended Rewrite rule into .htaccess.

RewriteEngine On
RewriteRule ^([^.]+)?$ /index.php/$1

eZpublish now builds the correct URL in the link, but I get a 403 error: "Forbidden You don't have permission to access /news on this server."

I changed the permissions for index.php and the eZpublish directory to apache, but still no luck.

I then followed another tip in a post and put the Rewrite rule in the Vhosts.conf file on my development machine. This worked properly.

However, I am on a shared server in a virtual host environment and would rather use the .htaccess Rewrite rule than to have to rely on the hosting provider modifing the Vhosts.conf files everytime I host a new domain in eZpublish. (It is a multi-site installation.)

I am running eZpublish-3.3-2 on Mandrake9.2 on my development machine, with Apache2.0.47 and php-4.3.3.

Does anyone have any suggestions why the Rewrite rule works in Vhosts.conf and not in .htaccess, and any tips for making it work in .htaccess?

Thanks

Iain

Vidar Langseid

Thursday 26 February 2004 2:44:13 am

If you want to run eZ publish without "index.php" appearing in the URL, I think you need to have the rewrite rules in apache conf, not in a .htaccess file

Iain MacLean

Thursday 26 February 2004 2:55:55 am

Thanks Vidar

I have seen one or two postings from people who reckon they have made the .htaccess rewrite rules work. Guess I'll just have to stick with the Apache vhosts.conf option. Not so easy on a shared server, but the guys who host my sites are pretty helpful.

Cheers
Iain

Thorsten Studt

Monday 13 September 2004 8:50:26 am

If your hoster runs Confixx 2 and above, and offers frontpage extensions, ask them to enable them on any (new and unused) subdomain pointing to your root (like 'frontpage.yourdomain.com' pointing to '/'). Without doing so, the rewrite engine does not work if you put it into .htaccess.

Ekkehard Dörre

Monday 13 September 2004 6:03:54 pm

Hi,

you can take .htaccess:

http://ez.no/community/forum/install_configuration/htaccess_hidden_at_last

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Iain MacLean

Tuesday 14 September 2004 3:45:20 am

Hi guys

Thanks for the tips.

Thorsten, my hoster uses Cpanel rather than Confixx, so that might not be the problem. I'll check it out, though.

Ekke, I've had a look at the post you suggest. That might be the solution I want - I'll give it a try.

Cheers
Iain

eZ debug

Timing: Jan 18 2025 19:25:30
Script start
Timing: Jan 18 2025 19:25:30
Module start 'content'
Timing: Jan 18 2025 19:25:31
Module end 'content'
Timing: Jan 18 2025 19:25:31
Script end

Main resources:

Total runtime1.6515 sec
Peak memory usage4,096.0000 KB
Database Queries207

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0118 588.9688180.8203
Module start 'content' 0.01181.4850 769.7891642.1250
Module end 'content' 1.49680.1547 1,411.9141337.0625
Script end 1.6515  1,748.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.2430210.0002
Check MTime0.00160.0941210.0001
Mysql Total
Database connection0.00120.073010.0012
Mysqli_queries1.567294.89352070.0076
Looping result0.00270.16442050.0000
Template Total1.605597.220.8027
Template load0.00180.111020.0009
Template processing1.603797.100520.8018
Template load and register function0.00020.012710.0002
states
state_id_array0.00170.104710.0017
state_identifier_array0.00250.150920.0012
Override
Cache load0.00160.0957380.0000
Sytem overhead
Fetch class attribute can translate value0.00160.099350.0003
Fetch class attribute name0.00180.106470.0003
XML
Image XML parsing0.00130.081650.0003
class_abstraction
Instantiating content class attribute0.00000.000770.0000
General
dbfile0.00300.1787270.0001
String conversion0.00000.001230.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/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
1content/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: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs