dongrouyuan5685 2015-08-11 11:41
浏览 52

将特定的php请求重定向到非php url

I can't seem to get a .htaccess redirect to work on a site i'm working on,

I've tried all sorts of setups but the one that should be working still gives a 404, heres the file:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^register register.php [QSA]

RewriteCond $1 !^(index\.php|login\.php|register\.php|phpmyadmin|images|public|assets|uploads|themes|install|updates|asset|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]

The file exists in the www/ directory

Any help would be appreciated as I seem to be having a blonde moment.

Update:

I'm trying to get domain.com/register to load domain.com/register.php, basically trying to remove the file extension.

  • 写回答

2条回答 默认 最新

  • douju9847 2015-08-11 11:50
    关注

    Try with following code .

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://domain.com/register/$1 [R=301,L]
    

    Some online tools available . Just search in Google " Htaccess generator"

    评论

报告相同问题?

悬赏问题

  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来