Login | Register | FAQ
Anonymous

How to make clean url just in php

+ Post a reply

5 posts Page 1 of 1


How to make clean url just in php

by adrijan » Mon Jul 28, 2014 11:07 am

Hello i am newby in learning php
I like to know is it possible to make clean url just in php not using .htaccess rewriting
I have one small script which is like small website and i wish to have clean url but if is possible using only php
my url now is skripta.php?akc=proiz and i want it to be like skripta.php/proizvodi

I wish to upload here my script but i couldnt becose of security reasons of this website http://www.html.net
If anybody have some idea how i could solve this issue i will be appreachiated
User avatar

adrijan

  • Posts: 11
  • Joined: Mon Jul 28, 2014 7:24 am

Re: How to make clean url just in php

by XainPro » Thu Jul 31, 2014 9:20 am

you can not do this without url rewrite
url rewrite is very easy what the issue with url rewrite ?
User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: How to make clean url just in php

by adrijan » Sat Aug 02, 2014 10:25 pm

Did i need to make a rule for every link or i can make rule for generally all links on my site?
How you will solve link localhost/skripta.php?akc=proiz to show like localhost/scripta/proizvodi in htaccess ?
Sorry but i dont have any experience with it so i ask better someone who know if he can explaine to me
Thanks
User avatar

adrijan

  • Posts: 11
  • Joined: Mon Jul 28, 2014 7:24 am

Re: How to make clean url just in php

by XainPro » Sun Aug 03, 2014 6:11 pm

no you only need to create 1 rule in your htaccess file
here is a good tutorial where you can learn how to write your url redirection rule

http://www.smashingmagazine.com/2011/11 ... rewriting/
User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: How to make clean url just in php

by adrijan » Sat Aug 09, 2014 5:14 pm

I did some rewrite rule in my .htaccess and it is written like that:

RewriteEngine On
RewriteRule ^([^/]*)\.php$ /12dan/skripta.php?akc=$1 [L]

and my link is http://localhost/12dan/skripta.php?akc=proiz

But it show me some error
What did i wrong?
User avatar

adrijan

  • Posts: 11
  • Joined: Mon Jul 28, 2014 7:24 am


+ Post a reply

Page 1 of 1