1

i am working within sub folder of my website and i want to rewrite my urls.

i have never done this before nor have any knowledge of rewriting rules.

I have a file which named show.php which takes parameter id which is any no and then it echo that no on to the screen.

Now this file is in folder name polo.

 www.xyz.com/polo/show.php 

i want to rewrite

 www.xyz.com/polo/show.php?id=10 

to

 www.xyz.com/polo/id/10 

I tried this answer but still its not working.

Subfolders using htaccess

Any help would be appreciated.

1 Answer 1

1

Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^(polo)/(id)/([0-9]+)/?$ /$1/show.php?$2=$3 [L,QSA,NC] 
Sign up to request clarification or add additional context in comments.

7 Comments

its not working here is live url iam testing on seooutlook.com/polo/show?id=565656
http://www.seooutlook.com/polo/id/565658 is generating 500 error. Can you check your error.log and tell me what is the error there.
when iam using seooutlook.com/polo/id/10 It returns 500 Internal Server Error
Can you check your error.log and tell me what is the error there.
ur solution is working now .. it seems like this error is occuring because of my other rewrite rule in .htaccess file.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.