-2

I have a URL, looking below:

www.abc.com/postblog.php?url=xyz

I just want to remove [ postblog.php?url= ]. How i do this. i want my new url look like this:

www.abc.com/xyz

or

www.abc.com/blog/xyz

I am using a windows server, and i am applying both type of file web.config & .htaccess . Which one is worked and how i implement this url formation.

  • 4
    Possible duplicate of [URL rewriting with PHP](http://stackoverflow.com/questions/16388959/url-rewriting-with-php) – leoap Dec 26 '16 at 12:49
  • You can use [routes in PHP](https://stackoverflow.com/questions/125677/php-application-url-routing) and thus be server independant whether it's Apache, Nginx or anything else. You'll also need some [Regular Expressions](https://secure.php.net/manual/fr/function.preg-match.php) skills in order to do so. – Amin NAIRI Dec 26 '16 at 13:16

1 Answers1

1

Check this: https://httpd.apache.org/docs/current/howto/htaccess.html

*In general, you should only use .htaccess files when you don't have access to the main server configuration file.

  • I am using a windows server, and i am applying both type of file web.config & .htaccess . Which one is worked and how i implement this url formation. – Sanjay Sangal Dec 29 '16 at 06:51