+ 3
Convert Dynamic url to seo friendly url in php
I have a php file which generate url like http://example.com/file.php?c=text1&s=text2&z=text3. I want to get url in below format http://example.com/id/text1/text2/text3 I am trying mod rewrite but i am not able to do it. Please provide me a suitable code to do this
7 ответов
+ 7
Freezemage Not necessarily...
URL rewriting can be implemented at the server level rather than the application level, which is what you are referring to with MVC routing.
+ 5
What happens when you apply the rewrite rules in your .htaccess file?
If your .htaccess file in the correct directory?
Paste the rewrite rules you applied.
Also, are you certain the mod rewrite module is enabled in your web server?
I'm assuming you are using Apache Web Server. If that correct?
+ 4
Wow, dude, that's a lot you need to do.
You need a routing system that will determine based on current URL what the user wants from current view instance, transfer the parsed result to controller and THEN do the work.
Try reading about URL Routing and MVC paradigm.
+ 4
Aditya The notes in your code are great. I'll take a look and will respond in the comments thread of your code.
+ 3
I added the code i am using. Can you pls tell what i am doing wrong. Can you please provide a simple code to do that. I don't want a complex routing system maybe simple one can do that .
https://code.sololearn.com/wkxS393lcdM0/?ref=app
+ 3
I tried to be clear, but in any case you get confusion on what i need from that code. Pls message me i will reply
+ 2
Link your non working code here.