【发布时间】:2019-08-29 17:56:59
【问题描述】:
我想重定向我的网址,其中包含带有 php 扩展名的下划线,例如
app_development_company.php 到 app-development-company.html 在 .htaccess 文件中。
看看我的 htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*\.js) gzip.php?type=js&file=$1
RewriteRule ^(.*\.css) gzip.php?type=css&file=$1
#RewriteBase /
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#RewriteRule ^index\.html$ index.php [L]
RewriteRule ^/$ index.php [L]
RewriteRule ^iphone-app-development\.html$ iphone_development.php [L]
RewriteRule ^mobile-app-development-jaipur\.html$ mobile-app-development-jaipur.php [L]
RewriteRule ^android-app-development\.html$ android_app_development.php [L]
RewriteRule ^404\.html$ 404.php [L]
ErrorDocument 404 https://wedigtech.com/404.html
</IfModule>
请帮我解决这个问题。
在此感谢您
【问题讨论】:
-
所以你想将任何
/foo-bar-baz-abcd.html重写为/foo_bar_baz_abcd.php?
标签: php html apache .htaccess mod-rewrite