/    Sign up×
Community /Pin to ProfileBookmark

I’ve been banging my head against a wall with this and can’t seem to get it to work.

Basically a client wants to have an easy url to promote a product e.g [url]www.domainname.com/folder[/url] and the 2nd ReWriteRule covers pointing this to the correct product page and works fine.

My problem however is I’m worried about people adding a trailing “/” to the url and the rewrite engine missing it. Which is why the 1st rule should redirect [url]www.domainname.com/folder/[/url] to [url]www.domainname.com/folder[/url] and so on to the product page. Unfortunately it doesn’t.

Any ideas?

[CODE]
RewriteEngine on

ReWriteRule ^folder/$ nspcc [R]
ReWriteRule ^folder$ index.php?page=product[/CODE]

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@pcthugOct 05.2006 — Use the [I]zero or one of a[/I] modifier (?), like so:
<i>
</i>RewriteEngine on

ReWriteRule ^folder/[color=red]?[/color]$ index.php?page=product
Copy linkTweet thisAlerts:
@sinciliteauthorOct 06.2006 — Cheers, thanks for that.

It goes to the correct page now anyway - one more bug to get over but I'm sure I can get that one for myself.

Thanks again!
×

Success!

Help @sincilite 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.24,
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,
)...