Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-17-2011, 06:32 PM   PM User | #1
keys88
New Coder

 
Join Date: Aug 2010
Posts: 55
Thanks: 26
Thanked 0 Times in 0 Posts
keys88 is an unknown quantity at this point
RewriteRule help

I would appreciate help with a RewriteRule.

This is nearly identical to other rules I use that work just fine, but something here isn’t right.

I have addresses that look like these:

Code:
http://mysite.com/reports/1103-march-17/?page=1&mode=pause
http://mysite.com/reports/1103-march-17/?page=5&mode=play
which call the local index file, thus doing the same as:

Code:
http://mysite.com/reports/1103-march-17/index.php?page=1&mode=pause
http://mysite.com/reports/1103-march-17/index.php?page=5&mode=play
and I want to be able to use short-form URLS like this:

Code:
http://mysite.com/reports/1103-march-17/1/pause
http://mysite.com/reports/1103-march-17/5/play
In the local folder’s htaccess I have this:
Code:
RewriteEngine On
RewriteRule ^(\d*)/(pause|play)$ ?page=$1&mode=$2  [NC,L]
but that changes the sample short-form URLS into
Code:
http://mysite.com/reports/1103-march-17/pause
http://mysite.com/reports/1103-march-17/play
in the address bar (with the "1/" or "5/" removed), and the browser returns "Not Found”.

This seems a simple substitution ... but ... ?

Thank you.
keys88 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 11:09 AM.


Advertisement
Log in to turn off these ads.