VirtualHost Config

Author Message

Tristan Koen

Friday 24 October 2003 5:39:37 am

Hi

I am trying to get rid of the index.php part of the URLs on my website (ie I would like the urls to look like http://www.mysite.com/content/view/full/2 instead of http://www.mysite.com/index.php/content/view/full/2). AFAIK, all I need to do is ensure that the virtualhosting stuff on apache is configured correctly.

It looks fine to me, but this part still isn't working. I am hoping that someone on this forum can direct me to the source of my problem.

The relevant parts of my httpd.conf look like:

NameVirtualHost 192.168.0.1
<VirtualHost 192.168.0.1>
ServerAlias www.mysite.com
<!-- Other config directives -->
</VirtualHost>

I have another virtualhost directive for the admin site.

My site.ini.append.php looks like:
[SiteAccessSettings]
MatchOrder=host
HostMatchType=map
HostMatchMapItems[]=mysite.com;rcc
HostMatchMapItems[]=www.mysite.com;rcc
HostMatchMapItems[]=admin.mysite.com;admin

If anyone can give me some pointers here, I would really appreciate it.

Thanks

Ole Morten Halvorsen

Friday 24 October 2003 5:49:37 am

Hi,

In httpd.conf, try to set
DirectoryIndex index.php

Remeber to restart apache.

See if that works.

-Ole

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

James Packham

Friday 24 October 2003 5:58:45 am

This might be of interest to you, a sample of my own http.conf. It's a slightly modified version of what you've got in yours that lets you have multiple virtual hosts on the same server - handy if you want to use phpmyadmin and ezpublish together, for example:

#-----------------------------------------------------------------
NameVirtualHost *:80

# View your site locally by entering localhost into the location
# bar of your browser
<Virtualhost *:80>
<Directory /var/www/html/ezpublish-my-sites/>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>

RewriteEngine On
RewriteRule !\.(gif|css|jpg|png|jar|js|html)$ /index.php

ServerAdmin root@localhost
DocumentRoot /var/www/html/ezpublish-my-sites/
ServerName localhost
</Virtualhost>

# View phpmyadmin locally by entering phpmyadmin into
# the location bar of your browser
<Virtualhost *:80>
<Directory /var/www/html/phpMyAdmin-2.5.4/>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>

RewriteEngine On
RewriteRule !\.(gif|css|jpg|png|jar|js|html)$ /index.php

ServerAdmin root@localhost
DocumentRoot /var/www/html/phpMyAdmin-2.5.4/
ServerName phpmyadmin
</Virtualhost>

# View your site from the web by entering it's internet url
# into the location bar of your browser
<Virtualhost *:80>
<Directory /var/www/html/ezpublish-my-sites/>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>

RewriteEngine On
RewriteRule !\.(gif|css|jpg|png|jar|js|html)$ /index.php

ServerAdmin root@localhost
DocumentRoot /var/www/html/ezpublish-my-sites/
ServerName www.myezpublish.no-ip.com
</Virtualhost>
#-----------------------------------------------------------------

You probably need to change your match order to uri instead of host, or put "uri, " before host. Either that or I've read your question wrong and have just wasted both of our time ;)

~James~

Tristan Koen

Friday 24 October 2003 7:18:10 am

Thanks for the replies.

Ole: I have DirectoryIndex index.php together with a few other directives (rewrite rules, etc) in my .htaccess file. Should this make a difference.

James: What you have there is very similar to what I have except that I have to specify an IP address (the same box is used for hosting multiple sites) and that some of my directives are located in my .htaccess file for the site.

Regards,

Tristan

Jerry Jalava

Friday 24 October 2003 7:33:36 am

Hi,

I have a small prob with vhosts also...
I need to get one folder inside eZ's folder to act as its own url...
Example:
My ez is running in url: www.mysite.com (www.mysite.com/page1 etc.)
So everything after .com/ goes through index.php.
And I need one folder to go like www.mysite.com/folder
It cannot do it now, 'cause it goes through index.php.

How can I make an overwrite to htacces or httpd.conf so this specific folder wouldn't go through index.php and would act normally?

Regards,
Jerry

Tony Wood

Friday 24 October 2003 9:26:54 am

Jerry,

Try this http://ez.no/developer/ez_publish_3/documentation/configuration/configuration/tips_tricks/exclude_uris_from_rewrite

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Jerry Jalava

Friday 24 October 2003 10:03:46 am

Hi Tony,

Thanks for the link, but my eZ is still giving me "module not found error". :(

I have restarted apache many times already...

Hope there's still some solution.

Regards,
Jerry

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