/    Sign up×
Community /Pin to ProfileBookmark

"clean urls"

I’ve been trying for quite a while to get clean urls to work.

You know so

/article.php?show=name

becomes

/article/name

I am using this in the apache config file:

<FilesMatch “^atricle$”>
ForceType application/x-httpd-php
</FilesMatch>

but my question is how can I get it to work in a .htaccess file?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@scragarAug 16.2008 — RewriteRule article/(.*) article.php?show=$1
be sure to turn on the settings before it though(it's only needed once, so if you've already got it leave them be)Options +FollowSymlinks
RewriteEngine on
Copy linkTweet thisAlerts:
@Declan1991Aug 16.2008 — Do you not wantRewriteRule article.php?show=(.*) article/$1or in PHP[code=php]
header('Location: http://domain.com/article/'. $_GET['show']);
[/code]
Copy linkTweet thisAlerts:
@TaboauthorAug 17.2008 — RewriteRule article/(.*) article.php?show=$1
be sure to turn on the settings before it though(it's only needed once, so if you've already got it leave them be)Options +FollowSymlinks
RewriteEngine on
[/QUOTE]

This doesn't work, maybe I'm doing something wrong...?

I have rewriteengine on and Options +FollowSymlinks...?
×

Success!

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