how to rewrite a url

I have an image gallery at www.testsite.com/gallery/index.php?/category/stuff

and I want it to be found at this url with this url showing in the address bar

www.testsite.com/gallery

Can I do this in the htaccess file?
LVL 1
tf2012Asked:
Who is Participating?
 
RartemassService Desk AnalystCommented:
0
 
käµfm³d 👽Commented:
The htaccess file cannot affect what you see in the address bar (unless you use something like Helicon SEO library). You would therefore put "www.testsite.com/gallery" in your HTML and within your htaccess file you would have a rule that would translate the incoming "www.testsite.com/gallery" into "www.testsite.com/gallery/index.php?/category/stuff". I believe something like this would do it:

RewriteEngine On
RewriteRule ^gallery$ /gallery/index.php?/category/stuff [L]

Open in new window

0
 
tf2012Author Commented:
thnx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.