Wordpress is installed in the blog folder in the root directory, so the address becomes http://mydomain.com/blog
Log path http://mydomain.com/blog/sample-post/
Can I use RewriteRule to change the path of wordpress to http://mydomain.com/sample-post and hide the blog?
(sample-post is not fixed, it is the name of each log, variable)
After reading htaccess for a long time, I didn’t understand how to write it.
I would also like to ask a questionRewriteRule . /index.php [L]
The meaning of this sentence
Some people will have an additional index.php in the path after installing wordpress, so they need to add this sentence Remove index.php
Syntax for rewriting rules:
RewriteRule Pattern Substitution [flags]
An explanation I saw is this:
Pattern is a perl-compatible regular expression that acts on the current URL.
Substitution in the rewrite rule is the string used to replace (or replace) when the original URL matches Pattern.
Then this is not using index.php to replace any character (I am not sure what this pattern means, doesn't the '.' in the regular expression represent any single character)?
Please explain, thank you~
rewriterule ^/blog/([\/]+) /$1 [L]
Solve it yourself...
Although it can be accessed normally if you remove the blog field in the URL, if you jump through the link in the page, the URL still has its own blog. Forget it, I'll move the directory...