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"

    评论

报告相同问题?