Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 10-11-04
DanielCoe's Avatar
Home is where I hang my @
 
Join Date: Sep 2003
Location: My Bedroom
Posts: 406
Thanks: 0
Thanked 0 Times in 0 Posts
DanielCoe is an unknown quantity at this point
  Quick Mod-ReWrite Question

Hi,

Can anyone tell me why on some of my hosts my dummy mod written urls stay in the url address bar, while on other hosts the hidden/long url is displayed in the address bar.

All .htaccess files are the same, for example:

RewriteEngine on
RewriteBase /
RewriteRule ^hello-(.*).htm /hello.php?id=$1 [R]

So on one host hello-123.htm will stay in the address bar once clicked on, while on others the hello.php?id=123 is displayed in the address bar.

If there something wrong with the way I am writing the htacess stuff? Or is it just different hosts install Apache modrewrite in differing ways?

Thanks

Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-11-04
Super Moderator
 
Join Date: Aug 2003
Posts: 2,451
Thanks: 0
Thanked 0 Times in 0 Posts
Rich is an unknown quantity at this point
The [R], which means force redirect, is what causes the hello-123.htm to be replaced with hello.php?id=123, so if you just want the former to stay in the address bar you don't want the [R].

Normally you would use [R] if you had moved a page to a new url and you wanted users to be redirected to the new page.

Where as you would use it without the [R] if you wanted the webserver to accept one url, rewrite it and pass it to different url internally, but send the output back as if it came from the original url (i.e when moving query strings into the main url)

As for why its working differently on different servers, I'm not sure if they all have [R] in the same places - I can't see that there is anyway to disable just internal or external redirects.

This post is probably not much use unless you spot a rogue [R].
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-11-04
DanielCoe's Avatar
Home is where I hang my @
 
Join Date: Sep 2003
Location: My Bedroom
Posts: 406
Thanks: 0
Thanked 0 Times in 0 Posts
DanielCoe is an unknown quantity at this point
Thanks for your help.

Is there a good site where I can see a list of what all the [] words mean, like [Q],[L],[R] etc.

And don't say the Apache site.

Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-11-04
Super Moderator
 
Join Date: Aug 2003
Posts: 2,451
Thanks: 0
Thanked 0 Times in 0 Posts
Rich is an unknown quantity at this point
Not sure if you meant not the Apache site as in don't give an obvious answer or as in you had already looked there, but it is the best refference I've found. There isn't that much to mod_rewrite really.

http://httpd.apache.org/docs/mod/mod_rewrite.html

Scroll down to the contents then click on RewriteRule then about two screens down is the definition of all the flags.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 11-11-04
DanielCoe's Avatar
Home is where I hang my @
 
Join Date: Sep 2003
Location: My Bedroom
Posts: 406
Thanks: 0
Thanked 0 Times in 0 Posts
DanielCoe is an unknown quantity at this point
Thanks mate,

Your a good help - as always!

It was just the [R] !!

Have you got any other major tips for me - I've got lots of time on my hands for listening! (or reading).

Daniel

Last edited by DanielCoe; 11-11-04 at 05:38 PM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7