0

I have URL that will be like that :

http://example.com/directory/index.php?q=anything 

so that the PHP will load the test variable using $_GET['q'].

I wish to simplify this in my .htaccess to :

http://example.com/directory/anything.html

How would i go about doing this?

Alisha
  • 43
  • 1
  • 7
  • There's a similar question that may be of some value to you. [htaccess rewrite for query string](http://stackoverflow.com/questions/1231067/htaccess-rewrite-for-query-string) – Ohgodwhy Mar 25 '13 at 06:05
  • http://stackoverflow.com/questions/15512690/redirect-dynamic-urls-including-querystring-with-htaccess – Dipesh Parmar Mar 25 '13 at 06:05
  • what framework are you using off? – Jhonathan H. Mar 25 '13 at 06:13
  • I'm Using PHP and was able to do `http://example.com/directory/anything` to my Url. Does it affect my **SEO**. I want to do `http://example.com/directory/anything.html` **i.e., adding suffix in the end of every url.Both the above thing at the same time** Does their any solution for that? – Alisha Mar 25 '13 at 12:52

2 Answers2

1

May be you could add something like this in .htaccess

RewriteEngine on

RewriteRule ([0-9A-Za-z-\+._]+)\.html$ ./index.php?q=$1
Salman
  • 9,299
  • 6
  • 40
  • 73
0

I have Myself resolve this issue :: here's The .htaccess code

RewriteEngine On
RewriteRule ^directory/([^/]*)\.html$ /directory/index.php?q=$1 [L]
Alisha
  • 43
  • 1
  • 7