![]() | | ||||||||
| | #1 |
| Active Warrior Join Date: May 2009
Posts: 45
Thanks: 5
Thanked 1 Time in 1 Post
|
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] |
| | |
| | |
| | #2 |
| Senior Warrior Member War Room Member Join Date: Nov 2006 Location: , , .
Posts: 2,461
Thanks: 1,044
Thanked 1,110 Times in 372 Posts
|
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] Then with your rule it'll convert it back internally and allow the script to figure out what to do. Hope that helps. Andy |
| | |
| | |
| | #3 |
| Active Warrior Join Date: May 2009
Posts: 45
Thanks: 5
Thanked 1 Time in 1 Post
|
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] Thanks for the help. |
| | |
| | |
| | #4 | |
| Senior Warrior Member War Room Member Join Date: Nov 2006 Location: , , .
Posts: 2,461
Thanks: 1,044
Thanked 1,110 Times in 372 Posts
| Quote:
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 | |
| | ||
| | |
| | #5 |
| Active Warrior Join Date: May 2009
Posts: 45
Thanks: 5
Thanked 1 Time in 1 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] Thanks. |
| | |
| | |
| | #6 | |
| Senior Warrior Member War Room Member Join Date: Nov 2006 Location: , , .
Posts: 2,461
Thanks: 1,044
Thanked 1,110 Times in 372 Posts
| Quote:
Cheers, Andy | |
| | ||
| | |
| | #7 |
| Active Warrior Join Date: May 2009
Posts: 45
Thanks: 5
Thanked 1 Time in 1 Post
|
Thanks Andy, I really appreciate it!
|
| | |
| | |
| | #8 |
| Senior Warrior Member War Room Member Join Date: Nov 2006 Location: , , .
Posts: 2,461
Thanks: 1,044
Thanked 1,110 Times in 372 Posts
|
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] Cheers, Andy |
| | |
| | |
| | #9 |
| Active Warrior Join Date: May 2009
Posts: 45
Thanks: 5
Thanked 1 Time in 1 Post
|
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.
|
| | |
| | |
| | #10 |
| Senior Warrior Member War Room Member Join Date: Nov 2006 Location: , , .
Posts: 2,461
Thanks: 1,044
Thanked 1,110 Times in 372 Posts
|
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] |
| | |
| | |
| | #11 |
| Active Warrior Join Date: May 2009
Posts: 45
Thanks: 5
Thanked 1 Time in 1 Post
|
Hm.. Still having the same problem.. Don't feel like a failure either I've been struggling over this for days.
|
| | |
| | |
| | #12 |
| Senior Warrior Member War Room Member Join Date: Nov 2006 Location: , , .
Posts: 2,461
Thanks: 1,044
Thanked 1,110 Times in 372 Posts
|
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 |
| | |
| | |
| | #13 |
| HyperActive Warrior Join Date: Apr 2009
Posts: 193
Thanks: 3
Thanked 15 Times in 12 Posts
|
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. |
| | |
![]() |
|
| Tags |
| mod, rewrite |
| Thread Tools | |
| |
![]() |