Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-05-15 18:36:36
- werther
- Member
- Registered: 2008-05-13
- Posts: 16
clean urls
Hello,
I wrote in the other day with problems and simply switched to ?messy urls so I could get started on learning the basics of textpattern. Now I really would like to get clean urls working. I am running Apache 1.3 with the mod_rewrite module and PHP 5.1.4. I am only using this as a testing/development environment on laptop. Mac OS X
I followed the instructions in the faq linktext
but it still does not work. My diagnostics run fine with the exception saying the clean urls are not working.
The only problem I think I may be having is putting in the wrong path in the .htaccess file where I’ve uncommented RewriteBase
in my browser in order to navigate to the site the path is like so:
http://localhost/~me/mysite
the path in my finder is:
/Users/Me/Sites/mysite
what path should I put into the Rewritebase in .htaccess?
-Thank you.
Offline
Re: clean urls
The RewriteBase
goes after RewriteEngine On
. I would just change the DocumentRoot
. See this. If I remember correctly, Tiger’s Apache install is in /etc/httpd/. Leopard’s is located in /etc/apache2/.
Offline
#3 2008-05-15 19:17:33
- werther
- Member
- Registered: 2008-05-13
- Posts: 16
Re: clean urls
I don’t have a file by the name of httpd-virtualhost. I have httpd.conf. I have changed AllowOverride from None to FileInfo. Are you saying to change the document root from within httpd.conf? And if so what exactly am I changing it to? Sorry I rarely have messed with Apache.
Thank you
Edit: and I am still not sure what path to put into the .htaccess file?
Thanks again
Last edited by werther (2008-05-15 19:20:04)
Offline
Re: clean urls
Sorry, I should have clarified. You don’t need virtualhosts, but if you want them, check out this evolt article. For the DocumentRoot, open httpd.conf and search for DocumentRoot. It should say something like /Library/WebServer… Change it to /Users/Me/Sites. After you change it, save it, then run sudo apachectl restart
from Terminal.
Although you won’t need the RewriteBase if you do the above (since http://localhost/~me/ will be the same as http://localhost), you can try RewriteBase ~/me
. I’ve never dealt with RewriteBase before, so it probably won’t work.
Last edited by jm (2008-05-15 19:47:15)
Offline
#5 2008-05-15 21:52:37
- werther
- Member
- Registered: 2008-05-13
- Posts: 16
Re: clean urls
Thanks jm,
However, I still can’t get it to work. I changed the DocumentRoot and the Directory (it says to change this as well and I tried it both ways). Do you have any other Ideas?
Thanks
Offline
#6 2008-05-15 22:02:09
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: clean urls
I am still not sure what path to put into the .htaccess file?
.htaccess might be the problem. It should reside side by side with your “textpattern”, “images”, and “files” folders.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#7 2008-05-15 22:04:01
- werther
- Member
- Registered: 2008-05-13
- Posts: 16
Re: clean urls
thanks, but it is in the same folder as those folders.
Offline
#8 2008-05-15 22:06:31
- werther
- Member
- Registered: 2008-05-13
- Posts: 16
Re: clean urls
when installing textpattern I used the site url that textpattern picked form me: 127.0.0.1/~me/mysite
-is this correct?
Offline
Re: clean urls
If you changed your DocumentRoot
to /Users/Me, then you don’t need ~me
.
Offline
#10 2008-05-16 00:51:18
- werther
- Member
- Registered: 2008-05-13
- Posts: 16
Re: clean urls
I changed it to /Users/me/Sites – the httpd.conf file
is that not right?
I am referring to under the admin panel/preferences tab; Site URL
in there I have 127.0.0.1/~mick/mysite
Last edited by werther (2008-05-16 01:00:58)
Offline
Re: clean urls
No, that is correct. Since you changed it, you do not need ~me
in the site URL. So you should be accessing your site (/Users/Me) from http://127.0.0.1
(or http://localhost
), not http://127.0.0.1/~me/
.
- Run
sudo apachectl configtest
to double check your edits. If it’s OK, thensudo apachectl restart
. rm ~/Sites/mysite/textpattern/config.php
- Open
http://localhost/mysite/textpattern/setup/
and reinstall. - Check Admin>diagnostics
If clean URLs still fail, you might need to add Options FollowSymLinks
to your .htaccess file (or /etc/httpd/users/me.conf).
Oh wait, did you ever uncomment AllowOverride All
in httpd.conf?
Last edited by jm (2008-05-16 02:30:41)
Offline
#12 2008-05-16 02:26:37
- werther
- Member
- Registered: 2008-05-13
- Posts: 16
Re: clean urls
I don’t know….I thought about just uninstalling all my crap and installing xampp, but I have a lot of scripts utilizing mysql. I am starting to consider giving up on this locally and just testing clean urls on the hosts setups.
I have uninstalled/reinstalled textpattern. I have completely rebuilt my .conf file (learned a lot…I guess not enough) and I can’t think of what else it could be. I am sure the problem lies in my httpd.conf file though.
at the bottom of my .conf file I have this:
<IfModule mod_php4.c>
# If php is turned on, we repsect .php and .phps files.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
bc. # Since most users will want index.php to work we
bc. # also automatically enable index.php
bc. <IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
</IfModule>
#<IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{REQUEST_METHOD} ^TRACE
# RewriteRule .* - [F]
#</IfModule>
<IfModule mod_bonjour.c>
# Only the pages of users who have edited their
# default home pages will be advertised on Bonjour.
RegisterUserSite customized-users
#RegisterUserSite all-users
# Bonjour advertising for the primary site is off by default.
#RegisterDefaultSite
</IfModule>
Include /private/etc/httpd/users/*.conf
-could any of that be screwing it up? (I commented out the mod_rewrite part thinking it might be a conflict with the .htaccess file but that didn’t work.
Last edited by werther (2008-05-16 02:32:21)
Offline