Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 546
  • Last Modified:

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?
0
tf2012
Asked:
tf2012
2 Solutions
 
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
 
RartemassAuthor, martial arts coach, IT ConsultantCommented:
0
 
tf2012Author Commented:
thnx
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now