How to get www.xxxx.xxx/topic to work without a / at the end???

Hi All.

I would like to be able to set a URL to www.xxxxx.xxx/anything and let visitors load the index.htm page in the folder (anything). I have directory listing enabled for the site, but I can only load the index page if I put / after the foldername. Is the any way to make this work. It used to work for the site (hosted at an internet company) but I can get it to work after we moved the site to our own server running on a xserve (10.4.11)

Any help would be great.. 😉

Xserve 2x2 GHz Dual-Core Intel Xeon, Mac OS X (10.4.11)

Posted on Jan 16, 2009 3:23 PM

Reply
5 replies

Jan 17, 2009 5:26 PM in response to MrHoffman

Hi MrHoffman

Thanks for the advice. But if I go to

Server Admin > select the server > Web > Settings > Modules > mod_dir

I already have a checkmark in it. I then tried to remove the checkmark and save the config. Then the web service stops. And when I try to restart the web service I get an error. (Tried this in hope of removing it and then setting it on again would end the problem)

It tells me to check the error log...
Here is the last errors in the log

[Sun Jan 18 02:13:39 2009] [notice] Accept mutex: flock (Default: flock)
[Sun Jan 18 02:15:37 2009] [notice] SIGUSR1 received. Doing graceful restart
Processing config directory: /etc/httpd/sites/*.conf
Processing config file: /etc/httpd/sites/0000 xxx.xxx.xxx.xxx_80www.xxxxx.dk.conf
Syntax error on line 7 of /etc/httpd/sites/0000 xxx.xxx.xxx.xxx_80www.xxxxx.dk.conf:
Invalid command 'DirectoryIndex', perhaps mis-spelled or defined by a module not included in the server configuration
Processing config directory: /etc/httpd/sites/*.conf
Processing config file: /etc/httpd/sites/0000 xxx.xxx.xxx.xxx_80www.xxxxx.dk.conf
Processing config file: /etc/httpd/sites/0001 xxx.xxx.xxx.xxx_80www.yyyyyy.dk.conf
Processing config file: /etc/httpd/sites/0002 xxx.xxx.xxx.xxx_80www.zzzzzz.dk.conf
Processing config file: /etc/httpd/sites/0003 xxx.xxx.xxx.xxx_80www.aaaaaaa.dk.conf
Processing config file: /etc/httpd/sites/0004 xxx.xxx.xxx.xxx_80www.bbbbbbb.dk.conf
Processing config file: /etc/httpd/sites/virtual hostglobal.conf
[Sun Jan 18 02:17:27 2009] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Sun Jan 18 02:17:27 2009] [warn] pid file /var/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sun Jan 18 02:17:27 2009] [notice] Apache/1.3.41 (Darwin) mod_jk/1.2.23 mod_ssl/2.8.31 OpenSSL/0.9.7l configured -- resuming normal operations
[Sun Jan 18 02:17:27 2009] [notice] Accept mutex: flock (Default: flock)


If I then set the checkmark again and save config I can restart the web service.

Any advice how to solve this would be great, as we have a catalog out telling people to use www.xxxxx.dk/anything (without /) to go to a specific web page...

Jan 17, 2009 6:38 PM in response to Dr. Virus

Ok; so if you have the option enabled (which you should) and then the startup works (which is good) which means mod_dir is enabled and likely operational.

Ok.

The brute-force approach to approach this is via the .htaccess file created in the directory (ls -al) or via the core httpd.conf configuration file; via enabling and using mod_rewrite to rewrite the URL. Basically, you "fix" the "busted" URL on the way past the mod_rewrite module.

I tend to use .htaccess. To enable .htaccess, there's a knob. Buried in the configuration file there's usually:
AllowOverride None

and changing that to:
AllowOverride All

causes Apache to go look in .htaccess in the target directory.

Something akin to the following (ugly, but functional) code will get you close, see the apache.org web site or any of the mau Apache tutorial sites and documents for details on mod_rewrite...

#
RewriteCond %{REQUEST_FILENAME} wxyz/$ <NC>
RewriteRule ^(.*)$ lookoverthere <L>

RewriteCond %{REQUEST_FILENAME} wxyz$ <NC>
RewriteRule ^(.*)$ lookoverthere <L>

The above shows angle brackets where you'll need to use square brackets in the real .htaccess file.

Or (once you get dug out here?) get help with Apache for this sort of case. There are ways to do redirecting and campaign-specific URLs and such via parameters, for instance.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to get www.xxxx.xxx/topic to work without a / at the end???

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.