I trying to remove folder/folder name from url using htaccess

前端 未结 1 1853
走了就别回头了
走了就别回头了 2021-01-24 12:16

I want to change the URL
My Url
http://localhost/MotoMate/corporate/company/kenstar My target url will be
http://l

相关标签:
1条回答
  • 2021-01-24 13:03

    Try this code in /Moto/.htaccess:

    RewriteEngine on 
    RewriteBase /MotoMate/ 
    
    RewriteCond %{THE_REQUEST} /corporate/company/(\S*)\s [NC]
    RewriteRule ^ /%1? [R=302,L,NE]
    
    RewriteRule !^corporate/company/ corporate/company/$1 [L,NC]
    
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond $1 !^(index\.php|js|img|css|captcha|robots\.txt) 
    RewriteRule ^(.*)$ index.php/$1 [L] 
    
    0 讨论(0)
提交回复
热议问题