I'm developing a website and I want to make like a profile page.
I was wondering if I could change from profile?name=BlaBla
to profile/BlaBla
.
How can I do this?
I'm developing a website and I want to make like a profile page.
I was wondering if I could change from profile?name=BlaBla
to profile/BlaBla
.
How can I do this?
Try this
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^profile/(.*)$ ./profile?name=$1 [L]
I do not have enough reputation to comment above. It seems that the CSS and other resources path are getting messed up when you are rewriting urls.
Please try and fix the css path by providing absolute urls. You could also use the HTML tag to set the base url to use relative paths for resources.
For This Process Better to use MVC Framework. Because in MVC already set Routing then from Route it's good to secure your data as well as fomating will be http://your-URL/controller/ID
. I suggest you should use Codeigniter or Laravel Framework for this project. Or If you are generating API then use CodeIgniter, Laravel or Slim Framework for Routing.