How we can convert dynamic url into static url? plz provide
code.
Answer Posted / udit rawat
Add an .htaccess file(if using apache)
# Turn on URL rewriting
RewriteEngine On
RewriteBase /
# Allow any files or directories that exist to be displayed
directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]
This redirects all urls to index.php. index.php will be some
sort of front controller that loads scripts based on the url
So in your example:
localhost/mywebsite/mypage
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
Explain me soundex() and metaphone()?
What is form validation in php?
What was the old name of php?
Can we embedded directly PHP code into XHTML document? State Whether True or False?
How do you end a function in python?
What is difference between web service and api?
How to call a php function from html button?
Explain the difference between session and cookies in php?
What the limitation of header() function in php?
How to Retrieve a Cookie Value?
Can php run on windows server?
Inside a php function, what param needs to be set in order to access a global variable?
How to remove the new line character from the end of a text line?
Can php replace javascript?
How do I run a php script?