Community « Discussion forum « Post your requirements here «
Bernard - Shorter URLS :)
http://www.ngr78.co.uk/articles/view.php/17/pages/2 rewritten to:
www.ngr78.co.uk/articles/view/17/pages/2 Give it a try
Requires this rewrite rule:
This needs to be placed before
eg:
To test this we added the following line in global.php:
eg
Obviously this needs coding correctly for getting the correct filename and generating the correct URLs
Cheers Nick (and a big help from Martyn)
www.ngr78.co.uk/articles/view/17/pages/2 Give it a try
Requires this rewrite rule:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([^0-9]+)/([0-9]+) $1.php/$2 [L]This needs to be placed before
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
eg:
# translate authentication data if PHP runs as CGI -- see agents/feed.php
#
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([^0-9]+)/([0-9]+) $1.php/$2 [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
To test this we added the following line in global.php:
$path = str_replace('view', 'view.php', $path);eg
if(isset($_SERVER['REQUEST_URI'])) {
$path = str_replace('?'.$_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']);
$path = str_replace('view', 'view.php', $path);
if($here = strpos($path, '.php/')) {Obviously this needs coding correctly for getting the correct filename and generating the correct URLs
Cheers Nick (and a big help from Martyn)
| Bernard from nearby-an-airport Associate, 7053 posts | Your idea is good, because it makes things so simple. I will definitely give it a try within coming days. Thank you very much for this nice contribution. |
Simplify3![]() from Naples, FL 51 posts | Simplify3: trouble! Rewrites suddenly not working after upgrade to 7.6! I don't want to mess up my nicely-indexing site on Google - this could kill me - help! Ken http://free.naplesplus.us/ |
Simplify3![]() from Naples, FL 51 posts | My fix for broken 7.6 (php 4.4.0) short links: in GLOBAL.PHP: Changed $_SERVER['PATH_INFO'] to $HTTP_SERVER_VARS['ORIG_PATH_INFO'] // analyze script args (e.g. 'articles/view.php/123/3', where '123' is the article id, and '3' is the page number) In case it makes a difference, my .htaccess is: # This file adds nice features to YACS Hope this works for someone else! Ken, http://free.naplesplus.us/ |


