0

http://andeywala.in/single-post.php?title_slug=opportunities-in-India-by-Andeywala

are requested. I want to remove the single-post.php?title_slug= and such that the resulting URL becomes:

www.mydomain.com/opportunities-in-India-by-Andeywala

2 Answers2

0

You can do this by adding a rewrite rule to your .htaccess file.

RewriteEngine On
RewriteRule ^([^/]*)$ /single-post.php?title_slug=$1 [L]
Gerrit Fries
  • 143
  • 1
  • 13
0

What you are looking for is called pretty urls, there is plenty of documentation available both on Google and StackOverflow as well.

In any case, if you are using Apache server that supports .htaccess files, you will need to create rewrite rules like below in the .htaccess file:

RewriteEngine On
RewriteRule ^$ index.php
RewriteRule ^([a-zA-Z0-9-]+)/?$ single-post.php?title_slug=$1
deepanshu223
  • 146
  • 3
  • i had used tht but it can't work as well i am using apache and support .htaccess file but still it's not working. are you having other way to short my url – Shankar Mukati Sep 23 '17 at 12:41
  • It's not going to work correctly without htaccess file or apache configuration because the server has to send it to the path. It would be helpful if you could edit your question to include the configuration that you have tried and is not working. – deepanshu223 Sep 23 '17 at 13:11