Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Naming a section 'index' throws a 404
I have a site where a section named index throws a 404 error. It worked previously, so it’s likely something I’ve done (or not done) on the host itself. The 404 error is thrown with pretty (i.e., not messy) URLs and works as it should (i.e., 200 status) when index is renamed to index0 or something that doesn’t clash with, presumably, index.php. Please note I am requesting http://example.com/index/ with a trailing slash, not http://example.com/index (i.e., no trailing slash).
Semi-skimmed diagnostics:
Textpattern version: 4.5.7 (r5900)
Last update: 2014-09-27 13:25:45/2015-05-13 12:33:29
Document root: /var/www/vhosts/example.com/www/live
$path_to_site: /var/www/vhosts/example.com/www/live
Textpattern path: /var/www/vhosts/example.com/www/live/textpattern
Permanent link mode: section_id_title
Temporary directory path: /tmp
Site URL: example.com
PHP version: 5.5.9-1ubuntu4.9
GD Graphics Library: 2.1.1-dev; supported formats: GIF, JPG, PNG.
Server TZ: Europe/London
Server local time: 2015-06-12 16:12:40
DST enabled?: 0
Automatically adjust DST setting?: 0
Time zone: Europe/London (0)
MySQL: 5.5.43-37.2
Locale: en_GB.UTF-8
Server: Apache/2.4.7 (Ubuntu)
Apache version: Apache/2.4.7 (Ubuntu)
PHP server API: apache2handler
RFC 2616 headers: 
Server OS: Linux 3.13.0-43-generic
Active plugins: rah_replace-0.4.2
Admin-side theme: classic 4.5.7
Pre-flight check: 
------------------------
Image directory is not writable: /var/www/vhosts/example.com/www/live/images
File directory path is not writable: /var/www/vhosts/example.com/httpdocs/files
The following PHP functions (which may be necessary to run Textpattern) are disabled on your server: pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority, 
------------------------
.htaccess file contents: 
------------------------
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default
<IfModule mod_rewrite.c>
	RewriteEngine On
	#RewriteBase /relative/web/path/
	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^(.+) - [PT,L]
	RewriteCond %{REQUEST_URI} !=/favicon.ico
	RewriteRule ^(.*) index.php
	RewriteCond %{HTTP:Authorization}  !^$
	RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#php_value register_globals 0
# SVG
AddType image/svg+xml  svg svgz
AddEncoding gzip       svgz
<IfModule mod_gzip.c>
	AddOutputFilterByType DEFLATE text/plain
	AddOutputFilterByType DEFLATE text/html
	AddOutputFilterByType DEFLATE text/xml
	AddOutputFilterByType DEFLATE text/css
	AddOutputFilterByType DEFLATE application/xml
	AddOutputFilterByType DEFLATE application/xhtml+xml
	AddOutputFilterByType DEFLATE application/rss+xml
	AddOutputFilterByType DEFLATE application/javascript
	AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
------------------------Any advice from additional eyes very warmly received. Thank you.
Offline
#2 2015-06-12 15:51:36
- uli
- Moderator
 
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: Naming a section 'index' throws a 404
This comes to mind, but …
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Naming a section 'index' throws a 404
Thanks, uli – no directory called index, and no other files called index.*, either. I am completely stumped.
Offline
Re: Naming a section 'index' throws a 404
I tried this on my Textpattern demo (link in my sig) – same web host but different datacenter – it also throws a 404 on a section called index. Again, nothing untoward on that site at all – vanilla Textpattern 4.5.7 release. Weird.
Offline
Re: Naming a section 'index' throws a 404
Try putting this in your .htaccess file:
DirectoryIndex xedni.phpAnd rename the index.php file to xedni.php
Offline
Re: Naming a section 'index' throws a 404
ruud wrote #291519:
Try putting this in your .htaccess file:
DirectoryIndex xedni.php...And rename the index.php file to xedni.php
200 OK
Neat workaround -thanks, ruud.
It does make me wonder – is this perhaps caused by a misbehaving or missing Apache module?
Offline
Re: Naming a section 'index' throws a 404
The 404 error you got, was that generated by Textpattern or by Apache?
Offline
Re: Naming a section 'index' throws a 404
ruud wrote #291524:
The 404 error you got, was that generated by Textpattern or by Apache?
Apache.
Edit: to clarify/confirm, messy urls (?s=index) work as they should.
Last edited by gaekwad (2015-06-13 15:53:01)
Offline
Re: Naming a section 'index' throws a 404
I’ll put this thread to bed for now – I can easily change the section name to something else, no big deal.
Ruud – thanks very much for the help and workaround, much appreciated.
Offline

