there's probably a very simple answer to my question, but after hours of browsing I still haven't found a solution, so thank you very much for all your help. Perhaps I should mention that I'm using a subdomain with Bluehost (multiple domains on the same account).
I would like to rewrite: www.example.com/myfolder to www.example.com/index.php?s=myfolder
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /index.php?s=$1 [L]
Thank you very much for your help. Roland
Have you checked this: https://aloneonahill.com/blog/url-rewriting-for-beginners
RewriteEngine on RewriteRule ^/?Some-text-goes-here/([0-9]+)$ /picture.php?id=$1
To rewrite to index, use:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)/?$ /index.php?s=$1 [L]
And for css, scripts, or pictures, use absolutes links (which begin with /
or http://...
) or add <base href="/">
in html head.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.