我想从所有网址中删除.php扩展程序还想将用户重定向到没有文件扩展名的链接,如果有人使用 .php 输入网址。
更改此网址
http://localhost/xyz.com/post-add
htaccess
所有文件的都可以if(newQuestion.length() > 35){
String first_part = newQuestion.substring(0,newQuestion.length()/2);
String second_part = newQuestion.substring(newQuestion.length()/2);
question1.setText(first_part + "\n" + second_part);
}
else{question1.setText(newQuestion + "");}
吗?
答案 0 :(得分:0)
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]