GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 30-Jun-2003, 16:51
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
I've just realised that pages like
http://www.topfunwebsites.com/mambo/...age&Sub Menu= are not being crawled properly by Google, its cutting them off like this: http://www.topfunwebsites.com/mambo/...page&Itemid=47 and therefore missing all the subpages there.

I think it might be my time to attempt a re-write rule on the site. I tried once before, but I got all kinds of errors and chickened out of it.

Rob
  #2  
Old 30-Jun-2003, 16:55
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Go for it, I'll be more than happy to help you - but you know that already!
  #3  
Old 30-Jun-2003, 17:20
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
Thanks man.

Ok here goes nothing:

I've got this from somewhere else that had a mambo mod_rewrite htaccess file.

Code:
RewriteEngine On RewriteRule ^article(.*).html$ index.php?option=articles&task=viewarticle&artid=$1 RewriteRule ^content(.*).html$ index.php?option=displaypage&Itemid=$1&op=page&SubMenu= RewriteRule ^brands(.*).html$ index.php?option=articles&Itemid=$1 RewriteRule ^offers(.*).html$ index.php?option=news&Itemid=$1 RewriteRule ^links(.*).html$ index.php?option=weblinks&Itemid=4

For /index.php?option=displaypage&Itemid=47&op=page&Sub Menu= I would like to see something like http://www.topfunwebsites.com/mambo/e-cards/ecards.html

For /index.php?option=displaypage&Itemid=58&op=page&Sub Menu= I would like to see something like
http://www.topfunwebsites.com/mambo/...limpfish1.html

For /index.php?option=displaypage&Itemid=56&op=page&Sub Menu= I would like to see http://www.topfunwebsites.com/mambo/...is-castle.html

So here goes my attempt:
Code:
RewriteEngine On RewriteRule ^e-cards/ecards(.*).html$ index.php?option=displaypage&Itemid=47&op=page&SubMenu= RewriteRule ^e-cards/limpfish1(.*).html$ index.php?option=displaypage&Itemid=58&op=page&SubMenu= RewriteRule ^takeshis-castle(.*).html$ index.php?option=displaypage&Itemid=56&op=page&SubMenu=

How does this look.

Rob
  #4  
Old 02-Jul-2003, 08:58
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
I can't get to your website presently, I suspect it's the Google ads acting up, which it is today.
  #5  
Old 02-Jul-2003, 11:34
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

re: Rewrite urls for Mambo


Let's take this step by step:

Your query string in /index.php?option=displaypage&Itemid=47&op=page&Sub Menu=
only passes 4 values to the script in index.php i.e.
Code:
option = "displaypage" Itemid = 47 op = "page" SubMenu = ""

Out of these, if option, op and SubMenu doesn't change much, then you could effectively do the following:

File: .htaccess in the /mambo folder.
Code:
RewriteEngine On RewriteBase /mambo RewriteRule ^articles/(.*)\.html$ index.php?option=displaypage&op=page&Itemid=$1&SubMenu= [L]

Your html to show the links:
HTML Code:
<ul> <li><a href="/mambo/articles/47.html">E Cards</a></li> <li><a href="/mambo/articles/58.html">Limp Fish</a></li> <li><a href="/mambo/articles/56.html">Takeshi's Castle</a></li> </ul>

Rewriting URLS requires massive attention to the finest detail so expect a single misplaced slash here or there to mess up everything else.

Try this first - if and when it works, then, we can add to these rewrite rules and make some fancier changes.
  #6  
Old 02-Jul-2003, 12:05
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
I got a 403 saying that it couldn't access /mambo
  #7  
Old 02-Jul-2003, 12:07
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
OK, I'll have to replicate your site structure and test it out... but tomorrow Hang in there...
  #8  
Old 23-Jul-2003, 06:30
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
Ok the reason why I was getting errors was because I hadn't added
Options +FollowSymLinks

before turning on mod_write

The problem now is that it isn't actually working, its just being ignored.
e.g.
Code:
Options FollowSymLinks RewriteEngine On # direct one-word access RewriteRule ^/articles/?$ /tiki-view_articles.php [L] # access any object by its numeric identifier RewriteRule ^/article/?([0-9]+) /tiki-read_article.php?articleId=$1 [QSA,L] # todo add support for all characters allowed in a Wiki name # make sure this is the last rule! RewriteRule /([-_\+A-Za-z0-9]+)$ /tiki-index.php?page=$1 [QSA,L]

Can you see anything wrong their?
  #9  
Old 23-Jul-2003, 06:33
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Oh Rob... I am so sorry! I totally forgot about this thread... thanks for reminding me.

One quick question what's [QSA, L]?
  #10  
Old 23-Jul-2003, 06:48
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
qsa (query string append) - The help doc says that qsa forces the rewriting engine to append a query string part in the substitution string to the existing one instead of replacing it.
L means last.

Rob
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SE Friendly URLs Apache Bug? JamesRxx555 Web Hosting Forum 18 18-May-2004 05:50
Need rewrite help for cgi script Shop cart theblade24 Apache Web Server Forum 18 26-Jan-2004 06:23
Redirect multiple URLs to one script, masking true URL Maccaday Apache Web Server Forum 1 10-Dec-2003 09:34
rewrite in Apache2 lordklloyd Apache Web Server Forum 2 17-Nov-2003 07:20
Generating simple URLs for search engines jrobbio MySQL / PHP Forum 1 17-Mar-2003 12:22

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:33.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.