Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#121 2005-01-25 05:06:08

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

Does zem_rewrite support URLs of the form section.mydomain.com ?

Offline

#122 2005-01-25 10:02:24

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

It doesn’t do subdomains, but that’s a cool idea.


Alex

Offline

#123 2005-01-25 15:35:26

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

Yah, subdomains would be very nice! I’m moving my site in that direction and was hoping that

I have another question, what is the relationship between zem_rewrite and RSS/ATOM feeds? What version of links are generated in the feed? Are they consistent with the links that are on the website using zem_rewrite?

Offline

#124 2005-01-25 16:23:15

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

FYI – In order to fix the problem I was having with if_individual_article and if_article_list I added <code>extract($atts);</code> to the top of the doArticle function in publish.php.

Offline

#125 2005-01-25 16:26:57

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

I also modified publish.php to hack in some 404 handling. That way instead of getting a message that says “no page template specified for section” I redirect to another page.

If you want to do this, find the textpattern() function. For me its on line 160. Then change line 167 from this
<code>
if (!$html) exit(‘no page template specified for section ‘.$s);
</code>

to this
<code>
if (!$html) header(“Location: /”);
</code>

This redirects back to my home page. You could also create a section called 404 and redirect to “/404” or something to that effect.

Last edited by wilshire (2005-01-25 16:27:10)

Offline

#126 2005-01-26 00:10:34

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

> I have another question, what is the relationship between zem_rewrite and RSS/ATOM feeds? What version of links are generated in the feed? Are they consistent with the links that are on the website using zem_rewrite?

The feeds are hard-coded, so the only way to change the link format is to edit rss.php and atom.php. They produce links in the form /section/1234/. The ‘article_alt’ scheme in zem_rewrite is designed to parse these.


Alex

Offline

#127 2005-01-26 00:13:55

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

Wilshire,

Beware of using a redirect to handle missing pages. It can cause problems with search engines. Returning a 404 status is better, because it sends a clear signal that the requested URL is invalid.


Alex

Offline

#128 2005-01-26 04:49:18

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

So is there any way to return a 404 status but still show a custom 404 page using the plugin?

Offline

#129 2005-01-26 23:00:22

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

Edit the plugin code, and change the line print("The page you requested..."); to something like this:

readfile('/home/mydir/public_html/my404page.html');

You could use the same code (with header('Status: 404 Not Found')) in publish.php.

Last edited by zem (2005-01-26 23:01:41)


Alex

Offline

#130 2005-01-28 18:09:47

arpan
Member
Registered: 2004-12-02
Posts: 25

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

I’m a new user, and I probably am doing something wrong, but I’m unable to figure out how to get this to work.

I installed the plugin on a new install of textpattern on my computer. Pasted the required code in the .htaccess file. And I’ve enabled clean urls. but whenever I click on the article link on the front page, I get the following error:

Not Found

The requested URL /MAMP/seed3/article/1/first-post was not found on this server.
Apache/2.0.50 (Unix) PHP/5.0.2 Server at localhost Port 8888

I’m using MAMP (Mac, Apache, Mysql, PHP) on a Mac. What am I doing wrong.
Thanks for your help.
Arpan

Offline

#131 2005-01-28 21:16:39

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

arpan, did you replace TXP’s <txp:permlink> with <txp:zem_permlink>?

Offline

#132 2005-01-29 04:32:22

arpan
Member
Registered: 2004-12-02
Posts: 25

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

yes, I did that.

Makes no difference.

note: I tested using both of them and they links they create are identical.

Offline

#133 2005-01-29 09:13:40

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

Did you modify the plugin code like it is suggested at the top of the code view? I.e. did you create your own URL scheme?

Another possible problem: did you delete the old placeholder files from the root directory? They have to be gone for the plugin to work.

Last edited by andreas (2005-01-29 09:14:22)

Offline

#134 2005-01-29 13:17:16

arpan
Member
Registered: 2004-12-02
Posts: 25

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

I have only the following text in the .htacess file. it’s in the main folder of the txp site

RewriteEngine On
  1. Passthrough for existing files and directories
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+) – [PT,L]
  1. Everything else should go through Textpattern
    RewriteRule (.*) index.php

> Did you modify the plugin code like it is suggested at the top of the code view?
> I.e. did you create your own URL scheme?

I did not modify the plugin code. I didn’t think that anything needed to be changed.

>did you delete the old placeholder files from the root directory?

I’m working with a new install of TXP. I made sure that everything was working, and then I made tried installing this plugin. the version is 1.0RC1

Offline

#135 2005-01-29 15:05:36

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: [plugin] [ORPHAN] zem_rewrite: configurable clean URLs

Sorry, arpan, all that I can think of we’ve checked. I can’t say what else might cause the problem.

Did you create sections and categories?

Offline

Board footer

Powered by FluxBB