Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#145 2005-02-02 09:55:44

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

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

> Anyone know what the problem might be?

Best guess is that one or more of the necessary options isn’t permitted in .htaccess. Depending on the server config you might find a more specific error message in error_log.


Alex

Offline

#146 2005-02-02 10:27:18

Tobias Bergius
New Member
Registered: 2005-01-25
Posts: 2

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

[Wed Feb 02 11:10:07 2005] [alert] [client 127.0.0.1] C:/wwwroot/.htaccess: Invalid command ‘RewriteEngine’, perhaps mis-spelled or defined by a module not included in the server configuration

So, how do I fix this? :)

Offline

#147 2005-02-02 13:09:00

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

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

Sounds like you need to install mod_rewrite.


Alex

Offline

#148 2005-02-11 12:27:03

dapi
New Member
Registered: 2005-01-18
Posts: 2

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

Just for information,

I changed two lines of code so that the plugin uses url_title if it exists and just title if not.
(Case in use: I have url_title defined in Korean postings and don’t have it (don’t need to do so) in English postings.)

Under function zem_permlink($atts, $thing)
Below $scheme = empty($atts[‘scheme’]) ? ‘article’ : $atts[‘scheme’];
Add $url_title = empty($thisarticle[‘url_title’]) ? $thisarticle[‘title’] : $thisarticle[‘url_title’];
And Change ‘url_title’=>stripSpace($thisarticle[‘url_title’]),
To ‘url_title’=>stripSpace($url_title),

Then include {url_title} in uri_scheme.

That’s it! This way, the code will use url_title by default but if it doesn’t exist, will fall back to the title in permalink format.

Offline

#149 2005-02-11 19:24:12

bpk
New Member
Registered: 2005-01-27
Posts: 5

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

For some reason I cannot get this to work. Maybe I’m missing something here.

I’m using textpattern to manage a mostly static website: 7 simple pages or so. I have 7 defined sections and 7 articles, one for each section. Right now, calls to sections show the given pages of static content…

http://mydomain.com/?s=news

or

http://mydomain.com/?s=contact

where news and contact are the sections of the site.

I wanted to use zem_wewrite to clean the urls up a bit. The above would become…

http://mydomain.com/news/

and

http://mydomain.com/contact/

Here what I did…

(Background: I’m running apache on linux, textpattern 1.0rc1, and zem_rewrite-0.6, no other plugins installed)

1. installed the plug in first by file upload (and then by cut and paste—b/c I couldn’t get it to work)

2. Activated the plugin

3. Did NOT edit the default schemes in the plugin

$uri_scheme[‘article’] = ‘{section}/{article}/{title}’;
$uri_scheme[‘article_alt’] = ‘{section}/{article}/’;
$uri_scheme[‘category’] = ‘{section}/{category}/’;
$uri_scheme[‘section’] = ‘{section}/’;

4. Relaced original .htaccess with

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

(I tested re-write using the test providem by zem earlier in this post and the rewrite worked)

5. Deleted all placeholder files

6. Turned on /clean/ url admin, preferences

The result… It is similar to what jjeff spoke of. All urls just display the default home page (index.php).

http://mydomain.com/news/

displays the same as

http://mydomain.com/

Am I missing something? I tried the other test provided by zem to dump the variables

var_dump(serverSet(‘REQUEST_URI’), serverSet(‘PATH_INFO’));

and it successfully dumps ‘news’.

Any thoughts?? Thanks!

Offline

#150 2005-02-11 20:29:11

tommyhilfiga
New Member
Registered: 2005-02-06
Posts: 4

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

Hey,
@ bpk: Did you make two txt file named news, and contact, in the same directory as index.php?
each txt file must contain this code:
<?php include “./textpattern/config.php”; $s = “news”; include $txpcfg[‘txpath’].”/publish.php”; textpattern();
?>

@everyone: is there anyway to use comments_invite with zem_rewrite?

thanks in advance

Last edited by tommyhilfiga (2005-02-11 20:31:14)

Offline

#151 2005-02-11 20:39:43

bpk
New Member
Registered: 2005-01-27
Posts: 5

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

Thanks tommyhilfiga. I was under the impression that zem_rewrite did not require such files?? I didn’t see it mentioned in the documentation. I could have missed something though. I’ll double check.

Thanks.

Offline

#152 2005-02-11 23:29:01

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

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

zem_rewrite doesn’t require the section placeholder files. In fact it won’t work if you use them.


Alex

Offline

#153 2005-02-11 23:30:37

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

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

bpk,

That sounds like it could be caused by this bug.


Alex

Offline

#154 2005-02-11 23:30:56

The Safety Inspector
Member
From: London, UK
Registered: 2004-06-22
Posts: 32
Website

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

zem_rewrite looks nice. however, i have followed all of the steps exactly as outlined, and i am still having problems linking to anything. the zem_permlink displays a semantically correct link, and the URL seems correct, but i keep getting the followiing error:

Not Found
The requested URL /article/Hearth/5/lorem-ipsum was not found on this server.

you can go to <a href=“http://www.digital-hearth.com”>www.digital-hearth.com</a> and see that all of the links are giving the same error message. perhaps there’s something that isn’t happening somewhere along the line.

has anybody else experienced this?

thanks for any suggestions.

Offline

#155 2005-02-11 23:39:54

tommyhilfiga
New Member
Registered: 2005-02-06
Posts: 4

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

> zem wrote:

> zem_rewrite doesn’t require the section placeholder files. In fact it won’t work if you use them.

<del>@ zem: that really is odd you say that, as I was having the exact problem as bpk had, and I resolved it by adding those txt file…</del>

maybe my webserver didn’t regconize the changes in my .htaccess when I tried it…
anyway, that’s why I’m waiting for txp 1 to get the new design online with my website…

@ bpk : sorry for giving you the wrong info. <del>but it worked for me…</del> sorry mate

Last edited by tommyhilfiga (2005-02-11 23:43:41)

Offline

#156 2005-02-12 00:21:40

bpk
New Member
Registered: 2005-01-27
Posts: 5

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

zem: Thanks! But unfortunately, it didn’t solve my problem. Here is what I did as per the bug report…

The solution seems to be to shift line 57 down a couple of lines, after “extract($pretext)”.

After making the above change, all my links still work using this original scheme…

http://mydomain.com/?s=news

But now when I try…

http://mydomain.com/news/

the default home page loads (as it did before), but without the stylesheet. The link to the stylesheet is…

textpattern/css.php?s=default

So the the modification to publish.php didn’t work.

Thanks so much for your help. Any other ideas??

Offline

Board footer

Powered by FluxBB