Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 16-08-05
Registered User
 
Join Date: Sep 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
tezar is an unknown quantity at this point
  mod rewrite in root only

I have a mod rewrite working, but wat string do i need to add to make sure the mod rewrite is only in root directory.

As I have
test.html redirecting in root as I want
but /anydirectory/test.html and dont want this to redirect as its using same rewrite as root.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 16-08-05
mxp mxp is offline
Registered User
 
Join Date: Dec 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
mxp is an unknown quantity at this point
what rewrite rule are you using at the moment?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 16-08-05
Registered User
 
Join Date: Sep 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
tezar is an unknown quantity at this point
RewriteEngine on


RewriteRule ([a-zA-Z0-9]*)-([a-zA-Z0-9]*)\.html$ search.php?q=$1-$2 [L,NC]
RewriteRule ([0-9a-zA-Z]*)-([a-zA-Z0-9]*)\.html$ search.php?q=$1-$2[L,NC]
RewriteRule ([0-9a-zA-Z]*)-([0-9a-zA-Z]*)\.html$ search.php?q=$1-$2 [L,NC]
RewriteRule ([a-zA-Z0-9]*)\.html$ search.php?q=$1 [L,NC]
RewriteRule ([0-9a-zA-Z]*)\.html$ search.php?q=$1[L,NC]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 16-08-05
eskimo's Avatar
Registered User
 
Join Date: Aug 2003
Posts: 659
Thanks: 0
Thanked 0 Times in 0 Posts
eskimo is an unknown quantity at this point
You may need to drop the asteriks so that it does not match with the backslash in the other urls which point outside of the root.

I'm a bit rusty on mod rewrites.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 16-08-05
Registered User
 
Join Date: Mar 2004
Location: Reading, UK
Posts: 301
Thanks: 0
Thanked 0 Times in 0 Posts
dmorison is an unknown quantity at this point
I think you just need to add the start of string indicator to the match expression, as the / of any subdirectory is not matched by your current pattern so specifically excluding it won't make any difference. Try:

RewriteRule ^([a-zA-Z0-9]*)-([a-zA-Z0-9]*)\.html$ search.php?q=$1-$2 [L,NC]
RewriteRule ^([0-9a-zA-Z]*)-([a-zA-Z0-9]*)\.html$ search.php?q=$1-$2[L,NC]
RewriteRule ^([0-9a-zA-Z]*)-([0-9a-zA-Z]*)\.html$ search.php?q=$1-$2 [L,NC]
RewriteRule ^([a-zA-Z0-9]*)\.html$ search.php?q=$1 [L,NC]
RewriteRule ^([0-9a-zA-Z]*)\.html$ search.php?q=$1[L,NC]

(all i've added is the ^ to the front of each pattern)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 16-08-05
Registered User
 
Join Date: Sep 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
tezar is an unknown quantity at this point
Thanks all sorted now the ^ fixed it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 18-08-05
Registered User
 
Join Date: Jul 2004
Posts: 278
Thanks: 4
Thanked 0 Times in 0 Posts
paullas is an unknown quantity at this point
  .

hi

can anyone help me with a mod rewrite for my site http://www.birthday.co.uk as i ah screwed it up so many times trying to get it right

thanks

laskos
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #8 (permalink)  
Old 18-08-05
mxp mxp is offline
Registered User
 
Join Date: Dec 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
mxp is an unknown quantity at this point
what parts of the site are you having difficulty with?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 18-08-05
Registered User
 
Join Date: Jul 2004
Posts: 278
Thanks: 4
Thanked 0 Times in 0 Posts
paullas is an unknown quantity at this point
  .

hi

the whole thing i just cant seem to get my head into it at the moment. i am willing to pay someone to actually look at my site for me and tell me exactly what my mod rewrite needs to be for all my pages.

laskos
..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 18-08-05
mxp mxp is offline
Registered User
 
Join Date: Dec 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
mxp is an unknown quantity at this point
well i have to admit im far from an expert.

if you look at your gift ideas you have the following urls (for example)

http://www.birthday.co.uk/shopping/s...nfo.php?id=106

and what you want to achieve using modrewrite is

http://www.birthday.co.uk/shopping/showItemInfo/106

and i believe that the rewrite rule you will need to achieve this is

PHP Code:
Options +FollowSymlinks
RewriteEngine On
RewriteRule 
^shopping/showItemInfo/(.*)$  shopping/showItemInfo.php?id=$1[L
now the part it took me a while to figure out is that you have to redo the link in your html so the link for the above would need to become

http://www.birthday.co.uk/shopping/showItemInfo/106

what you need to be careful about is that when using a mod rewrite its important that the variable in the string are in the correct order. For example if you look at the links below both point to your index page but the variables do not appear in the same order.

http://www.birthday.co.uk/index.php?step=top&lang={'lang'}
http://www.birthday.co.uk/index.php?lang={'lang'}&step=search_ecard_1

hope thats of some help
cheers
mxp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #11 (permalink)  
Old 18-08-05
Affiliateer
 
Join Date: Jul 2005
Location: The Toon
Posts: 915
Thanks: 0
Thanked 1 Time in 1 Post
monk-i is an unknown quantity at this point
MXP how would that look in rewrite if there was 2 attributes to pass? such as ?id=106&uid=1234b7

You get what I mean? This is something I have looked at but gotten lost myself in the past and tended to opt for doing manual pages for most optimisation but I have to say it obviously isnt ideal in all situations.

Cheers mate
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 18-08-05
mxp mxp is offline
Registered User
 
Join Date: Dec 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
mxp is an unknown quantity at this point
i take it you mean something like this

PHP Code:
http://www.domain.co.uk/shopping/index.php?id=1&var=2 
which you'd want to become

<