Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-02-02 17:19:38

trailgirl
Member
Registered: 2004-06-04
Posts: 68
Website

Clean URLs on localhost Snow Leopard

I am running textpattern 4.2.0 on my MacBook with 10.6.2. Anyone know if it’s possible to use clean URLs? I tried everything in the FAQ. I have Textpattern installed in /Library/WebServer/Documents and access my site thru http://localhost. Thanks for any suggestions!

Offline

#2 2010-02-02 18:56:35

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Clean URLs on localhost Snow Leopard

I don’t really know what I’m talking about in this area, but I do have clean URLs working on Snow Leopard. I’m using the built-in Apache 2 server and PHP 5.3. As I recall the key was adding the following Directory block to /private/etc/apache2/users/Me.conf (substituting my login name for “Me”, in both file paths shown here; I had to create this file):

<Directory "/Users/Me/Sites/">
    Options All MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

As you can see I am using the “Sites” folder rather than the default /Library/WebServer/Documents. To get this working in the latter I suppose I would directly edit the second Directory block in /private/etc/apache2/httpd.conf


Code is topiary

Offline

#3 2010-02-02 20:32:01

trailgirl
Member
Registered: 2004-06-04
Posts: 68
Website

Re: Clean URLs on localhost Snow Leopard

I moved everything to my Sites directory and changed the Me.conf file (marcia.conf and directory is /Users/marcia/Sites/ (also restarted Apache) but still can’t use clean URLs. Went thru the .htaccess changes again from the FAQ but no luck so far.

Offline

#4 2010-02-02 21:02:18

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Clean URLs on localhost Snow Leopard

Can’t remember if I had to change this one or not, but the username.conf file needs to be included somewhere; in my case this happens in /private/etc/apache2/extra/httpd-userdir.conf (which itself is called in the default httpd.conf):

Include /private/etc/apache2/users/*.conf

Yes, restart Apache to test any such changes.


Code is topiary

Offline

#5 2010-02-02 23:40:53

trailgirl
Member
Registered: 2004-06-04
Posts: 68
Website

Re: Clean URLs on localhost Snow Leopard

It’s working with clean urls! Thank you for your help. The includes were there but it didn’t seem to acknowledge the users/*.conf or .htaccess (404 for localhost/~marcia but ok with localhost/~marcia/index.php) but I changed this in httpd.conf:

AllowOverride None to AllowOverride All in this section:

# AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

Restarted Apache (thru Sys Prefs).

Still didn’t work but getting closer.

Then tried different things in the .htaccess, finally figured out:

I had RewriteBase /Users/marcia/Sites/

but should be:

RewriteBase /~marcia/

Offline

#6 2010-02-03 00:22:59

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Clean URLs on localhost Snow Leopard

Glad you got it working. Setting up virtual hosts might also make things a bit easier (no need for RewriteBase directives, for one). I recommend VirtualHostX. Note that if you already have virtual hosts set up, VirtualHostX may conflict with this.


Code is topiary

Offline

Board footer

Powered by FluxBB