Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-03-28 23:49:24
- chariscomp
- Member
- Registered: 2006-03-02
- Posts: 14
Need help with clean urls in a subdirectory
Hello,
I have installed textpattern in a subdirectory and am having difficulty getting clean urls to work. My permlink settings are for /section/id/title. When I try to go to an article this way, I get a 404 error. My .htaccess file is as follows:
<code>
DirectoryIndex index.php index.html
Options +FollowSymLinks
RewriteBase /test/
RewriteEngine On
#RewriteBase /test/
RewriteCond %(REQUEST_FILENAME) -f [OR]
RewriteCond %(REQUEST_FILENAME) -d
RewriteRule ^/(.+) – [PT,L]
RewriteRule ^/(.*) index.php
</code>
The physical path to the folder is /www/vhosts/xxxxx.org/test/. This is where the .htaccess and the index.php files are. The url is xxxxx.org/test/. The perm link looks like xxxxx.org/test/schedule/2/church-schedule
Any suggestions on why this is not working? I have successfully installed Textpattern on the same host in a similar configuration except that the installation was not in a subdirectory. I want to keep this install in a subdirectory for now. I plan to move it out of a subdirectory later when development is further along.
Thanks for any help!
Joshua
Offline
#2 2006-03-29 00:42:50
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Need help with clean urls in a subdirectory
Is there a .htaccess file in the parent directory? Try moving it aside and see if it works.
Alex
Offline
#3 2006-03-29 02:44:25
- chariscomp
- Member
- Registered: 2006-03-02
- Posts: 14
Re: Need help with clean urls in a subdirectory
No, there is no .htaccess file in the parent folder. Any other suggestions?
Offline
#4 2006-03-29 03:30:57
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Need help with clean urls in a subdirectory
Experiment. That’s about it unfortunately — mod_rewrite’s behaviour is highly sensitive to the server configuration and environment.
Some pointers in the FAQ.
Alex
Offline
Re: Need help with clean urls in a subdirectory
When I try to go to an article this way, I get a 404 error.
Do you get a textpattern 404 or do you get a standard webserver 404?
What is sour site-url set to?
Offline
#6 2006-03-29 14:46:24
- chariscomp
- Member
- Registered: 2006-03-02
- Posts: 14
Re: Need help with clean urls in a subdirectory
Yes, it appears to be a server 404, not a textpattern 404. Here is the contents of my diagnostics screen
<code>
Textpattern version: 4.0.3 (r1188)
last_update: 2006-03-20 21:49:25/2006-03-20 21:38:56
Document root: /www/vhosts/xxxx.org (/usr/local/apache/vhosts/xxxx.org)
$path_to_site: /usr/local/apache/vhosts/xxxx.org/test
Textpattern path: /usr/local/apache/vhosts/xxxx.org/test/textpattern
Permanent link mode: section_id_title
Temp folder: /usr/local/apache/vhosts/xxxx.org/test/textpattern/tmp
Site URL: xxxx.org/test
PHP version: 4.3.10
Register globals: 1
server_time: 2006-03-29 07:43:42
MySQL: 4.1.9-standard-log
Locale: C
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/4.3.10
Apache version: Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/4.3.10
php_sapi_mode: apache
os_version: Linux 2.4.9-e.68smp
Pre-flight check:
————————————
Your version of PHP has security related risks. Please turn register_globals off or update to a newer PHP version.
————————————
.htaccess file contents:
————————————
DirectoryIndex index.php index.html
Options +FollowSymLinks
RewriteBase /test/
RewriteEngine On
#RewriteBase /test/
RewriteCond %(REQUEST_FILENAME) -f [OR]
RewriteCond %(REQUEST_FILENAME) -d
RewriteRule ^/(.+) – [PT,L]
RewriteRule ^/(.*) index.php
————————————
</code>
Does this help? Thanks for any further help.
Joshua
Offline
Re: Need help with clean urls in a subdirectory
Just for fun: Backup your htaccess file and place a new one in there with only the following lines:
RewriteEngine On
RewriteRule .* - [F]
Do you get a 404 Not found or a 403 Forbidden message when trying to access anything in that directory?
Because if it is still a 404 error you can be sure that mod_rewrite rules from the htacces file are ignored altogether. If however it is a 403 error, you may have lots of fun with trying to track down what exactly causes your problem… ;)
Offline
#8 2006-03-29 22:55:20
- chariscomp
- Member
- Registered: 2006-03-02
- Posts: 14
Re: Need help with clean urls in a subdirectory
Yes, unfortunately, I get a 403 error when I do what you suggest. Any other suggestions?
Thanks!
Joshua
Offline