Forum Moderators: phranque

Message Too Old, No Replies

How do i rewrite this?

         

john1000

8:04 pm on Jun 13, 2006 (gmt 0)

10+ Year Member



Hi,

I cant seem to find the right help for this..
in phpnuke i wanna use a php module.
its about 30 mb of pages..

i wanna use rewrite ...
url is like...modules.php?name=PHP_Manual
and the lines inside are ..

using seperate pages known as gt-nextgen,same as googletap.
in the gt file i have...

$urlin = array(
"'(?<!/)modules.php\?name=PHP_Manual&amp;page=([a-zA-Z0-9_-.]*)\.html'",
"'(?<!/)modules.php\?name=PHP_Manual'",
);

$urlout = array(
"php-manual-\\1.html",
"php-manual.html",
);

and in the htaccess i have..

RewriteRule ^php-manual-([a-zA-Z0-9_-]*).html modules.php?name=PHP_Manual&page=$1.html [L]
RewriteRule ^php-manual.html modules.php?name=PHP_Manual [L]

but it creates urls like....
php-manual.html&page=install.windows.html

and its just dead...and nothing shows...
Who can help solving this..

jdMorgan

5:25 pm on Jun 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know nothing about Googletap, and little about your PHP code. You might do better asking this in our PHP forum, in in a forum specific to phpnuke or Googletap...

However, a few points and questions:

Your PHP code must output the 'static'l-looking links on your pages. Mod_rewrite will then convert those back to query-string-type calls to your script.

I assume you have the required code to setup and enable mod_rewrite in your .htaccess file? That is:

 Options +FollowSymLinks
RewriteEngine on

I suggest you 'anchor' your patterns, 'root' your destination URLs, use the [NC] flag where applicable, and escape all literal characters:


RewriteRule ^php-manual-([a-z0-9_\-]*)\.html$ /modules.php?name=PHP_Manual&page=$1.html [NC,L]
RewriteRule ^php-manual\.html$ /modules.php?name=PHP_Manual [L]

Note that you could probably use the regex token "\w" instead of "_0-9A-Za-z"

Jim

john1000

10:31 pm on Jun 17, 2006 (gmt 0)

10+ Year Member



thanks ..ill give this a try...