These forums are now archived.


Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Noupe
PostPosted: Sat Mar 13, 2010 1:17 pm 
Offline
NetHosted Customer

Joined: Sat Jan 29, 2005 5:08 pm
Posts: 385

_________________
Getting the hang of it slowly (subject to comment)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Mar 13, 2010 1:33 pm 
Offline
NetHosted Staff
User avatar

Joined: Mon Mar 22, 2004 4:36 pm
Posts: 7373

_________________
| Andrew Bassett
| Managing Director, NetHosted Ltd.
| Earn £30 every time you refer someone to us!
| Follow us on Twitter:
| Members, tell us what of NetHosted!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 14, 2010 9:26 am 
Offline
NetHosted Customer

Joined: Sat Jan 29, 2005 5:08 pm
Posts: 385
cool, still don't understand it all lol

in the pdf sheet they say:

Example: Nice looking URLs (no querystring)
# domain.com/category-name/ to domain.com/categories.php?name=category-name
RewriteRule ^([A-Za-z0-9-]+)/?$ categories.php?name=$1 [L]

is that right? Isn't the description of what it does the wrong way around?

_________________
Getting the hang of it slowly (subject to comment)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 14, 2010 1:10 pm 
Offline
NetHosted Staff
User avatar

Joined: Mon Mar 22, 2004 4:36 pm
Posts: 7373
No that's right. You have to think how you want the domains to appear for users which is of the form domain.com/category-name/. So you would link to the category using that type of URL in your site code and you need mod_rewrite to seamlessly rewrite it so the actual php script does get called with the right query attached to it e.g. domain.com/categories.php?name=category-name

Andrew

_________________
| Andrew Bassett
| Managing Director, NetHosted Ltd.
| Earn £30 every time you refer someone to us!
| Follow us on Twitter:
| Members, tell us what of NetHosted!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 14, 2010 1:35 pm 
Offline
NetHosted Customer

Joined: Sat Jan 29, 2005 5:08 pm
Posts: 385
yes, but they say to create nice looking URLs and then their comment describes from/to and they are the wrong way around?

_________________
Getting the hang of it slowly (subject to comment)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 14, 2010 1:40 pm 
Offline
NetHosted Staff
User avatar

Joined: Mon Mar 22, 2004 4:36 pm
Posts: 7373
Their comment is right too, you in your code write the nice looking URL the rewrite rule is there to convert it back to the actual long form. So it does go nice url -> plain url.

I can see where your confusion is arising as you as the end user are looking to use a mod_rewrite solution to give your site nice looking short urls but in order for mod_rewrite to do that you have to give it the shorter urls to start with so it can convert them to the normal long version.

Andrew

_________________
| Andrew Bassett
| Managing Director, NetHosted Ltd.
| Earn £30 every time you refer someone to us!
| Follow us on Twitter:
| Members, tell us what of NetHosted!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 14, 2010 5:23 pm 
Offline
NetHosted Customer

Joined: Sat Jan 29, 2005 5:08 pm
Posts: 385
okay, sort of makes sense lol

so in real terms you keep the plane url as they are now and this rewrite will show it differently in the browser as well as allowing them to use both formats if they typed it?

_________________
Getting the hang of it slowly (subject to comment)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 14, 2010 5:33 pm 
Offline
NetHosted Staff
User avatar

Joined: Mon Mar 22, 2004 4:36 pm
Posts: 7373

_________________
| Andrew Bassett
| Managing Director, NetHosted Ltd.
| Earn £30 every time you refer someone to us!
| Follow us on Twitter:
| Members, tell us what of NetHosted!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: