hello
I just wont to make my site URL mutch more pretty
so how can I rewireite rule
if I wont to show
localhost/mysite/details/25
instatn of
localhost/mysite/details.php?id=25
You might find this site helpful @Hayk_Harutyunyan
3 Likes
you can put the below in your .htaccess file.
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
# Redirect /page.cfm?pagevar=abc123 to /Page/abc123
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+page\.cfm\?pagevar=([^&\s]+) [NC]
RewriteRule ^ /Page/%1? [R=301,L]
# Internally forward /Page/abc123 to /page.cfm?pagevar=abc123
RewriteRule ^Page/(.*)/?$ /page.cfm?pagevar=$1 [QSA,NC,L]
1 Like
Thank You, Your answer is very helpful,
I have in other question, I have “uploads” directory and anyone can access and see my uploaded files
http://myhost/uploads/
So I would like to close access , and only access from my code
Thank You for Advance.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.