/    Sign up×
Community /Pin to ProfileBookmark

Rewrite issue.

Hi There.

I was reading a tutorial here:
[url]http://www.phpriot.com/articles/search-engine-urls/2[/url]

and I tried to do it myself, however it didn’t seem to work.

I have some pages like this – index.php?page_id=[value]

and this is my .htaccess code

[CODE]
RewriteEngine on
RewriteRule ^/page/([0-9]+).html /index.php?page_id=$1
[/CODE]

It doesn’t rewrite the URL for some reason, does anyone know why?

Thanks
Peter

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@Jarrod1937Dec 27.2010 — Do you have mod_rewrite installed? What is the url you're trying to use with the rewrite rule? Have you created a simple test page and test rewrite to make sure it truly doesn't work? Sometimes its hard to differentiate between it not rewriting the url and it not rewriting it properly.
Copy linkTweet thisAlerts:
@iahneDec 28.2010 — are you trying to do it on a local server? if so, what's your local server?
Copy linkTweet thisAlerts:
@pedro93authorDec 28.2010 — @iahne,

Yes I am using Windows 7, IIS7.5 so my local URL is '127.0.0.1'

@Jarrod1937

I install PHP via IIS7.5 and I made sure PHP was installed with all extensions installed. I have uploaded the script to my website but I would like to keep the olnik private so I will PM it to you.

Thanks

Peter
Copy linkTweet thisAlerts:
@Jarrod1937Dec 28.2010 — I could be wrong (i rarely use IIS) but i believe IIS does not support .htaccess files which is an apache only feature. Along with this, i believe there is no standard url rewrite module loaded with IIS and you'll need to install something like:

http://www.micronovae.com/ModRewrite/ModRewrite.html

or

http://www.iis.net/download/URLRewrite

And then follow its instructions on configuring url rewriting.
×

Success!

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