Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-07-20 00:02:11

ragdoll
New Member
Registered: 2014-07-19
Posts: 3

Clean URLs in MAMP

I have just installed MAMP 3.0.5 and Textpattern 4.5.5, and I am trying to get Clean URLs working. I go to the following URL: http://localhost:8888/Rumpled%20Plover/

My page loads, I get the default design with yellow nav bar, CSS and Google fonts and all, but it is the 404 page for everything I look at, including the index and any articles.

  • I tried everything here: http://textpattern.com/faq/66/404-error-when-linking-to-article-pages
  • I am using the default .htaccess, and I’ve tried various combinations of uncommenting these lines,
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
  • I also tried setting
<Directory />
    Options Indexes FollowSymLinks
    AllowOverride None
</Directory>

to AllowOverride All

Is there something else I need to do with MAMP to get clean URLs working?

Offline

#2 2014-07-20 04:29:26

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Clean URLs in MAMP

It’s been a long time since I messed with MAMP but this is the ‘starter vanilla’ .htaccess file I use for TXP installations.

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /

#Textpattern
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*) index.php

</IfModule>

Options -Indexes

Offline

#3 2014-07-20 04:58:16

ragdoll
New Member
Registered: 2014-07-19
Posts: 3

Re: Clean URLs in MAMP

Thanks, but still nothing. Anytime I put in “RewriteBase /” it goes from being a nice, styled 404 page to a totally white page that just says

Not Found

The requested URL /index.php was not found on this server.

Here is what my current .htaccess looks like; but like I said, it’s just the default that comes with the Textpattern install:

#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default

<IfModule mod_rewrite.c>
	RewriteEngine On
	#RewriteBase /

	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

Any other ideas based on this?

Offline

#4 2014-07-20 05:42:02

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Clean URLs in MAMP

I never managed to get clean urls with mamp. I normally do all my local tests using messy mode. Having said that, I’m sure that somebody here did manage to make it work.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2014-07-20 19:30:18

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: Clean URLs in MAMP

hmmm. i thought that i had clean URLs working on MAMP but i see that for sections i am now seeing URLs of the form:

http://mechanics.dev/about/?c=be-our-service-expertise

instead of what i would expect:

http://mechanics.dev/about/be-our-service-expertise

…. texted postive

Offline

#6 2014-07-20 19:36:14

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Clean URLs in MAMP

Hey ragdoll – dumb question, and don’t take this personally: did you test messy mode URLs? Do they work as expected?

Edit: actually, ignore that. It’s likely RewriteBase. I’ll have a poke around on MAMP here and see if I can replicate.

Last edited by gaekwad (2014-07-20 19:41:22)

Offline

#7 2014-07-20 19:46:02

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Clean URLs in MAMP

No problem with clan URLs:

.htaccess:

<IfModule mod_rewrite.c>
	RewriteEngine On
	#RewriteBase /

	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^(.+) - [PT,L]

	RewriteRule ^(.*) index.php

	RewriteCond %{HTTP:Authorization}  !^$
	RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

Offline

#8 2014-07-20 19:49:36

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Clean URLs in MAMP

OK, I got clean URLs working on MAMP with the stock .htaccess, too. I had to change my site URL in Preferences because it was incorrectly listed.

ragdoll – can you post your diagnostics? For you, it should be here

Offline

#9 2014-07-20 19:52:01

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Clean URLs in MAMP

ragdoll wrote #282315:

Anytime I put in “RewriteBase /” it goes from being a nice, styled 404 page to a totally white page that just says

Try: RewriteBase /Rumpled%20Plover – when I uncomment RewriteBase / here, I get the 404 like you. Switching it with RewriteBase /Rumpled%20Plover fixes it for me.

Offline

#10 2014-07-20 20:11:53

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Clean URLs in MAMP

gaekwad wrote #282323:

I had to change my site URL in Preferences because it was incorrectly listed.

This is a reproducible bug/quirk when there’s a space character in the site URL. I made a screencast, it’s encoding now and I’ll upload it for an issue report.

Youtube: https://www.youtube.com/watch?v=3Ry6c4F-Ax0
Google Code: https://code.google.com/p/textpattern/issues/detail?id=421

Last edited by gaekwad (2014-07-20 21:02:44)

Offline

#11 2014-07-21 09:06:31

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: Clean URLs in MAMP

Just in case you’re missing the very first step: do you know that the mod_rewrite module is loaded? Check by calling up phpinfo (IIRC there’s a link on the mamp page, if not create a file with code as per this example) and then see if mod_rewrite is listed as an active module.

If not, take a look at httpd.conf on /Applications/MAMP/conf/apache to see if the “LoadModule rewrite_module modules/mod_rewrite.so” line is commented out with a # in front. If so, remove the # and restart.

If you’re using MAMP Pro, you can switch this on with via a tick-box under “Server > Apache”. You can also use your own mydomain.dev url instead of localhost.

bici: what you wrote above is normal behaviour for txp even with working clean urls. Your first example is a category list page, the second would be an article. If you’re not in a section (i.e. on the homepage), then you can use the clean url http://mechanics.dev/category/be-our-service-expertise.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2014-07-22 17:16:56

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: Clean URLs in MAMP

jakob wrote #282342:

bici: what you wrote above is normal behaviour for txp even with working clean urls. Your first example is a category list page, the second would be an article. If you’re not in a section (i.e. on the homepage), then you can use the clean url http://mechanics.dev/category/be-our-service-expertise

thanks for the clarification. so then in reply to the original question, yes i have clean URLS working with MAMP. I am using the PRO version.


…. texted postive

Offline

Board footer

Powered by FluxBB