性感的.htaccess URL重写重写、性感、htaccess、URL

2023-09-02 20:40:26 作者:时间怂恿深爱的人放手゜

我要得到我的所有域重写和好看。例如:

example.com/blog.php?article=the-name-of-article 变成 example.com/blog/the-name-of-article

所以我要带.php?文章=被改变成/

我目前的.htaccess文件如下:

 选项+了FollowSymLinks -MultiViews
RewriteEngine叙述上

的RewriteBase /

##隐藏PHP扩展
##要外部重定向/dir/foo.php到/ DIR /富
的RewriteCond%{THE_REQUEST} ^ [AZ] {3,}  S([^。] +)。PHP [NC]
重写规则^%1 [R,L,NC]

##在内部重定向/ DIR /富到/dir/foo.php
的RewriteCond%{} REQUEST_FILENAME -f .PHP
重写规则^%{REQUEST_URI}的.php [L]
 

但所有这确实是下降了的.php

我一直在寻找周围,但我只是想听听大家是如何实现这一那么容易。

解决方案

 重写规则^博客/(.*)$ blog.php的?文章= $ 1 [QSA,L]
 

详解HTTPS改造全过程

I want to get all my domains to rewrite and look good. for example:

example.com/blog.php?article=the-name-of-article to become example.com/blog/the-name-of-article

so i want the .php?article= to be changed into a /

my current .htaccess file looks like:

Options +FollowSymLinks -MultiViews
rewriteengine on

RewriteBase /

## Hide .php extension
## To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s([^.]+).php [NC]
RewriteRule ^ %1 [R,L,NC]

## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]

but all that does is drop the .php

I have been searching around but I just want to hear how everyone accomplishes this so easily.

解决方案

RewriteRule ^blog/(.*)$ blog.php?article=$1 [QSA,L]