.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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 06:15:47
Script start
Timing: Jan 31 2025 06:15:47
Module start 'layout'
Timing: Jan 31 2025 06:15:47
Module start 'content'
Timing: Jan 31 2025 06:15:47
Module end 'content'
Timing: Jan 31 2025 06:15:47
Script end

Main resources:

Total runtime0.0139 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.2578151.2266
Module start 'layout' 0.00460.0023 739.484436.6953
Module start 'content' 0.00690.0054 776.179794.1875
Module end 'content' 0.01230.0015 870.367237.9922
Script end 0.0138  908.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002316.4266140.0002
Check MTime0.00107.3237140.0001
Mysql Total
Database connection0.00074.864710.0007
Mysqli_queries0.002417.343830.0008
Looping result0.00000.079210.0000
Template Total0.00128.510.0012
Template load0.00096.337710.0009
Template processing0.00032.137210.0003
Override
Cache load0.00064.591110.0006
General
dbfile0.001913.757780.0002
String conversion0.00000.051640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs