War Room

Go Back   WarriorForum - Internet Marketing Forums > The Warrior Forum > Adsense / PPC / SEO Discussion Forum

Featured Warrior Special Offer...
"Members Of The *War Room* Discover Secrets To Immediate Success!"
Reply
 
LinkBack Thread Tools
Old 05-30-2009, 01:58 AM   #1
Active Warrior
 
Join Date: May 2009
Posts: 44
Thanks: 5
Thanked 0 Times in 0 Posts
Default Mod Rewrite help

I am trying to make SEO friendly urls. Im trying to make the url news.php?readmore=5 into /oddsmaker-sportsbook-bonus

The problem I'm having is that it doesnt change the URL in the browser for news.php?readmore=5 but if i type in /oddsmaker-sportsbook-bonus it shows up the way I want. I'm trying to get a link to readmore=5 to show the other url. Any advice? Here's my code.

Code:
RewriteRule ^oddsmaker-sportsbook-bonus/?$ news.php?readmore=5 [NC,L]

kristianw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-30-2009, 03:38 AM   #2
Senior Warrior Member
War Room Member
 
Andy Fletcher's Avatar
 
Join Date: Nov 2006
Location: , , .
Posts: 1,305
Thanks: 120
Thanked 130 Times in 75 Posts
Contact Info
Send a message via AIM to Andy Fletcher Send a message via MSN to Andy Fletcher Send a message via Skype™ to Andy Fletcher
Default Re: Mod Rewrite help

That rewrite rule will take effect on the server. If you want to force it to change on the client as well you need the following (typed straight into the forum so untested!).

Code:
RewriteRule ^news.php?readmore=5$ oddsmaker-sportsbook-bonus/ [NC,R]
Put that rule first and it'll force a 302 temporary redirect on the client if they go to news.php?readmore=5

Then with your rule it'll convert it back internally and allow the script to figure out what to do.

Hope that helps.

Andy

Andy Fletcher is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to Andy Fletcher For This Useful Post:
Old 05-30-2009, 12:55 PM   #3
Active Warrior
 
Join Date: May 2009
Posts: 44
Thanks: 5
Thanked 0 Times in 0 Posts
Default Re: Mod Rewrite help

Andy,

Not entirely sure i follow. I put that rule first like this

Code:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^news.php?readmore=5$
RewriteRule ^news.php?readmore=5$ oddsmaker-sportsbook-bonus/ [NC,R]
RewriteRule ^oddsmaker-sportsbook-bonus/?$ news.php?readmore=5 [NC,L]
It still isn't working.

Thanks for the help.

kristianw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-30-2009, 02:48 PM   #4
Senior Warrior Member
War Room Member
 
Andy Fletcher's Avatar
 
Join Date: Nov 2006
Location: , , .
Posts: 1,305
Thanks: 120
Thanked 130 Times in 75 Posts
Contact Info
Send a message via AIM to Andy Fletcher Send a message via MSN to Andy Fletcher Send a message via Skype™ to Andy Fletcher
Default Re: Mod Rewrite help

Quote:
Originally Posted by kristianw View Post
Andy,

Not entirely sure i follow. I put that rule first like this

Code:
RewriteEngine On
1. RewriteCond %{THE_REQUEST} ^news.php?readmore=5$
2. RewriteRule ^news.php?readmore=5$ oddsmaker-sportsbook-bonus/ [NC,R]
3. RewriteRule ^oddsmaker-sportsbook-bonus/?$ news.php?readmore=5 [NC,L]
It still isn't working.

Thanks for the help.
Oh, whoops. My mistake.

Line 1 is unnecessary since its just testing the same thing as the pattern match in line 2.

Line 2 should have an L in the [] at the end so it doesn't do line 3 as well, which just swaps it back.

Think that's right. If it's not I'll have to faff when I'm at my dev box.

Cheers,

Andy

Andy Fletcher is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-30-2009, 03:24 PM   #5
Active Warrior
 
Join Date: May 2009
Posts: 44
Thanks: 5
Thanked 0 Times in 0 Posts
Default Re: Mod Rewrite help

Hm.. still not working. If i go to Sportsbook Review - Sports Wagering, Top Online Sportsbooks - News: Odds Maker Sportsbook 100% Deposit Bonus it works correctly but still at Sportsbook Review - Sports Wagering, Top Online Sportsbooks - News: Odds Maker Sportsbook 100% Deposit Bonus it shows the dynamic url. Here is the updated code i am using
Code:
RewriteEngine On
RewriteRule ^news.php?readmore=5$ oddsmaker-sportsbook-bonus/ [NC,R,L]
RewriteRule ^oddsmaker-sportsbook-bonus/?$ news.php?readmore=5 [NC,L]
I really appreciate all the help. I've been trying to make this work for 2 days and still cannot figure it out.

Thanks.

kristianw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-31-2009, 05:21 AM   #6
Senior Warrior Member
War Room Member
 
Andy Fletcher's Avatar
 
Join Date: Nov 2006
Location: , , .
Posts: 1,305
Thanks: 120
Thanked 130 Times in 75 Posts
Contact Info
Send a message via AIM to Andy Fletcher Send a message via MSN to Andy Fletcher Send a message via Skype™ to Andy Fletcher
Default Re: Mod Rewrite help

Quote:
Originally Posted by kristianw View Post
Hm.. still not working. If i go to Sportsbook Review - Sports Wagering, Top Online Sportsbooks - News: Odds Maker Sportsbook 100% Deposit Bonus it works correctly but still at Sportsbook Review - Sports Wagering, Top Online Sportsbooks - News: Odds Maker Sportsbook 100% Deposit Bonus it shows the dynamic url. Here is the updated code i am using
Code:
RewriteEngine On
RewriteRule ^news.php?readmore=5$ oddsmaker-sportsbook-bonus/ [NC,R,L]
RewriteRule ^oddsmaker-sportsbook-bonus/?$ news.php?readmore=5 [NC,L]
I really appreciate all the help. I've been trying to make this work for 2 days and still cannot figure it out.

Thanks.
Hmm ... OK. I'll be back at my place in a couple of hours. Will figure it out and get back to you then. Feel free to prod me via PM if I haven't replied later on.

Cheers,

Andy

Andy Fletcher is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-31-2009, 12:18 PM   #7
Active Warrior
 
Join Date: May 2009
Posts: 44
Thanks: 5
Thanked 0 Times in 0 Posts
Default Re: Mod Rewrite help

Thanks Andy, I really appreciate it!

kristianw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-31-2009, 04:55 PM   #8
Senior Warrior Member
War Room Member
 
Andy Fletcher's Avatar
 
Join Date: Nov 2006
Location: , , .
Posts: 1,305
Thanks: 120
Thanked 130 Times in 75 Posts
Contact Info
Send a message via AIM to Andy Fletcher Send a message via MSN to Andy Fletcher Send a message via Skype™ to Andy Fletcher
Default Re: Mod Rewrite help

I'm an idiot. The initial pattern will have a / in front of it so neither of these rules will ever match -

Code:
RewriteEngine On
RewriteRule ^/news.php?readmore=5$ oddsmaker-sportsbook-bonus/ [NC,R,L]
RewriteRule ^/oddsmaker-sportsbook-bonus/?$ news.php?readmore=5 [NC,L]
Try that.

Cheers,

Andy

Andy Fletcher is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-31-2009, 05:07 PM   #9
Active Warrior
 
Join Date: May 2009
Posts: 44
Thanks: 5
Thanked 0 Times in 0 Posts
Default Re: Mod Rewrite help

That still doesn't seem to do it. Now if i type in readmore=5 it still shows that URL. If I use the URL I want to work it comes up with a 404 error.

kristianw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-31-2009, 05:12 PM   #10
Senior Warrior Member
War Room Member
 
Andy Fletcher's Avatar
 
Join Date: Nov 2006
Location: , , .
Posts: 1,305
Thanks: 120
Thanked 130 Times in 75 Posts
Contact Info
Send a message via AIM to Andy Fletcher Send a message via MSN to Andy Fletcher Send a message via Skype™ to Andy Fletcher
Default Re: Mod Rewrite help

Oh I'm just being a bit of a failure all around today.

You'll also need initial slashes on the replacement pattern as well -

Code:
RewriteEngine On
RewriteRule ^/news.php?readmore=5$ /oddsmaker-sportsbook-bonus/ [NC,R,L]
RewriteRule ^/oddsmaker-sportsbook-bonus/?$ /news.php?readmore=5 [NC,L]

Andy Fletcher is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-31-2009, 05:15 PM   #11
Active Warrior
 
Join Date: May 2009
Posts: 44
Thanks: 5
Thanked 0 Times in 0 Posts
Default Re: Mod Rewrite help

Hm.. Still having the same problem.. Don't feel like a failure either I've been struggling over this for days.

kristianw is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-31-2009, 05:22 PM   #12
Senior Warrior Member
War Room Member
 
Andy Fletcher's Avatar
 
Join Date: Nov 2006
Location: , , .
Posts: 1,305
Thanks: 120
Thanked 130 Times in 75 Posts
Contact Info
Send a message via AIM to Andy Fletcher Send a message via MSN to Andy Fletcher Send a message via Skype™ to Andy Fletcher
Default Re: Mod Rewrite help

Hmm ... OK that's odd. Now that exactly matches what I've got on my server.

I'm not going to be much more help without your hosting details. If you're happy for me to take a look inside your server please PM your login details but I understand if you're not happy to hand that kind of info out.

Cheers,

Andy

Andy Fletcher is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-01-2009, 03:27 AM   #13
HyperActive Warrior
 
Join Date: Apr 2009
Posts: 201
Thanks: 3
Thanked 14 Times in 11 Posts
Default Re: Mod Rewrite help

Yeah, Andy is right, it won't help without your hosting details...

But be carefull before handing your login id to some one. As, once I had given my details to a programmer for cerain programming and instead of resolving the issue he changed the ID for adsense... When for some days I saw zero earnings on my site, I got amazed. When checked in detail, I come to know that there were no adsense on the sites... Rather all the earnings were flowing to the programmers' ID.
1 Marketing is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > The Warrior Forum > Adsense / PPC / SEO Discussion Forum

Tags
mod, rewrite

Thread Tools

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 05:26 PM.