.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.