Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#136 2005-01-29 15:36:53

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

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

I have set up a basic install on a server.

Installed the zem_rewrite plugin, copied the .htacess file, and set the url to clean mode.

It’s located at: http://www.arkfam.org/txp/

the admin page is located at: http://www.arkfam.org/txp/textpattern/

login: test
password: textpattern

Perhaps you can tell me what’s wrong.

I have no idea what else to do.

Thanks for your help.

Offline

#137 2005-01-29 15:46:25

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

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

Arpan, have you modified the rewrites rules to take your /txp/ path into account ?

Try these (one at a time) for the last rule :

RewriteRule (.*) txp/index.php
RewriteRule (.*) /txp/index.php

On my host, I need the last one, but it depends on your host settings.

If it doesn’t work, try look at / (just upper Textpattern) and delete (just for testing) any .htaccess file that might be here.

Offline

#138 2005-01-29 16:24:38

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

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

> Arpan, have you modified the rewrites rules to take your /txp/ path into account ?

>Try these (one at a time) for the last rule :

>RewriteRule (.*) txp/index.php
>RewriteRule (.*) /txp/index.php

When I either of those, even the index page does not load, and I get the following error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@arkfam.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.33 Server at www.arkfam.org Port 80

—————
If it doesn’t work, try look at / (just upper Textpattern) and delete (just for testing) any .htaccess file that might be here.

I have deleted the other .htacess files. No difference. (note: those files were blank)

__

I am sure that I must be doing something wrong, but I’m just able to figure it out.

Thanks for taking the time to help me out. I really appreciate it.

Offline

#139 2005-01-29 16:30:23

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

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

Hey, ignore the previous post. It’s working now. I think it just took some time for the server to use the updated .htacess file.

Thanks for your help everyone. I really really appreciate it.

Offline

#140 2005-01-29 17:11:24

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

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

No trouble, the forums are here to help each other. For the record, which rule did work for you ?

Offline

#141 2005-01-29 17:13:39

mwjames
New Member
From: Memphis, TN USA
Registered: 2004-05-29
Posts: 2
Website

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

I was writing what I think is the reason zem_rewrite doesn’t work in off-the-shelf MAMPMAMP v1.0a3 (12-29-2004) doesn’t include an Apache2 mod_rewrite module — as I’d written up <a href=“http://maikimo.net/weblog/2005/01/local-txp-devel-in-mamp”>here</a>, when I see arpan write —

<blockquote>Hey, ignore the previous post. It’s working now. I think it just took some time for the server to use the updated .htacess file.</blockquote>

If it’s working as is, then I don’t know what I’m talking about. :-)

Last edited by mwjames (2005-01-29 17:16:13)

Offline

#142 2005-01-30 09:10:01

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

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

> mwjames wrote:

> I was writing what I think is the reason zem_rewrite doesn’t work in off-the-shelf MAMPMAMP v1.0a3 (12-29-2004) doesn’t include an Apache2 mod_rewrite module — as I’d written up <a href=“http://maikimo.net/weblog/2005/01/local-txp-devel-in-mamp”>here</a>, when I see arpan write —

<blockquote>Hey, ignore the previous post. It’s working now. I think it just took some time for the server to use the updated .htacess file.</blockquote>

>If it’s working as is, then I don’t know what I’m talking about. :-)

Um.., you do know what you’re talking about. It’s not working on MAMP on my computer on which I’m working on the website. But it is working on the web host’s server.

Since it’s working on that, I decided to just work on the website for now, and then worry about setting up clean urls later when i upload it to the server.

Offline

#143 2005-01-30 15:11:43

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

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

Re returning a 404 error status, the anc_header plugin might be of some help to you. I’ve also made a feature request for support for custom 404 error pages

Offline

#144 2005-02-02 08:37:22

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

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

Can’t seem to get this thing to work.
I’ve got RC2 in the www-root and have removed all the placeholder files.
My .htaccess file (in the root) looks like this:

DefaultType application/x-httpd-php
Options +Multiviews

<FilesMatch “^([^\.]+)$”>
ForceType application/x-httpd-php
</FilesMatch>

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

RewriteRule (.*) index.php

500 Internal Server Error. :(

Anyone know what the problem might be?

Last edited by Tobias Bergius (2006-07-18 04:00:09)

Offline

#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

Board footer

Powered by FluxBB