Joseph Witchard
08-14-2010, 04:36 AM
When I rewrite a URL with mod_rewrite, I've always done something to this effect:
RewriteRule ^show_news/([0-9]+)$ show_news.php?post_id=$1
However, I found a script online to force the user to connect to the website via HTTPS, and it was something like:
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
As you can see, the last bit is reversed compared to the first bit. What I mean is in the first code ends with the URL that's being rewritten. The last bit of code ends with the URL that's being created as the new URL. Is that because of the R flag that comes at the end?
RewriteRule ^show_news/([0-9]+)$ show_news.php?post_id=$1
However, I found a script online to force the user to connect to the website via HTTPS, and it was something like:
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
As you can see, the last bit is reversed compared to the first bit. What I mean is in the first code ends with the URL that's being rewritten. The last bit of code ends with the URL that's being created as the new URL. Is that because of the R flag that comes at the end?