-1

I want to just url rewriting in address bar from

https://www.tinycent.com/web/single_post.php?slug=samsung-sprint

to

https://www.tinycent.com/web/single_post/samsung-sprint

Any one can help me for this thing it's need to in better way also i had saw

More 10 demo at stackoverflow or other but he doesn't work for me.

confile
  • 29,115
  • 44
  • 187
  • 340
user2727842
  • 67
  • 1
  • 1
  • 2

1 Answers1

0

You can do something like this

    RewriteEngine On
    RewriteRule ^web/single_post/([^/]*)$ /web/single_post.php?slug=$1 [L]
Kamran
  • 2,631
  • 2
  • 14
  • 24
  • Hey Kamran Thanks's to Reply but issues does not solve i mean that's not work....... – user2727842 May 06 '15 at 11:01
  • can you share your directory structure so it will give a better idea and please make sure Apache mod redirect is enabled on your server. – Kamran May 06 '15 at 11:03
  • https://www.tinycent.com/web/single_post.php?slug=IPL-2015-RCB-v-MI-Highlights, web is subfolder for testing, and single_post.php i just need to url https://www.tinycent.com/web/IPL-2015-RCB-v-MI-Highlights – user2727842 May 06 '15 at 11:06
  • can you share your `.htaccess` file. – Kamran May 06 '15 at 11:12
  • Options +FollowSymlinks RewriteEngine on RewriteRule ^/web/single_post/([^/]*)$ /web/single_post.php?slug=$1 [L] RewriteCond %{HTTP_HOST} ^107\.180\.2\.62 RewriteRule (.*) http://www.tinycent.com/$1 [R=301,L] RewriteCond %{HTTP_USER_AGENT} libwww-perl.* RewriteRule .* – [F,L] RewriteBase / RewriteCond %{SERVER_PORT} !^443$ RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.tinycent.com/$1 [R=301,L] – user2727842 May 06 '15 at 11:14
  • add the `.htaccess` in your question and try to comment other two rules and test if it works. – Kamran May 06 '15 at 11:23
  • please check this url http://prntscr.com/724yhf – user2727842 May 06 '15 at 11:31
  • @user2727842 - You can remove the forward slash from `^/web` so that it becomes `^web` and it will work. @Kamran - please update your answer. – Mike Rockétt May 06 '15 at 13:01
  • @MikeRockett updated. Thanks for correction. I have edited the answer. – Kamran May 06 '15 at 13:10