/    Sign up×
Community /Pin to ProfileBookmark

rewrite problem?

i have the following URL

[code=php]domain.com/index.php?action=reserve&tp=1[/code]

and trying to rewrite it as

[code=php]domain.com/reserve/1[/code]

here is my htacces code, is there any one know what is the problem with this??

[code=php]RewriteRule ^([^/.]+)/([^/.]+)/?$ index.php?action=$1&tp=$2 [L][/code]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@jasonahouleApr 16.2007 — Here, try this:
<i>
</i>RewriteRule ^([A-Za-z]+)/([0-9])(/)?$ /index.php?action=$1&amp;tp=$2
Copy linkTweet thisAlerts:
@mahfoozauthorApr 16.2007 — its not working

actually i m testing it on localhost under some directory u may call it testrewrite

as

[code=php]localhost/testrewrite/index.php?action=reserve&tp=1[/code]
Copy linkTweet thisAlerts:
@jasonahouleApr 16.2007 — RewriteRule ^/testrewrite/([A-Za-z]+)/([0-9])(/)?$ /testrewrite/index.php?action=$1&tp=$2
×

Success!

Help @mahfooz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...