简体   繁体   中英

How do cantrol URL slash after main domain vis .htaccess

How do cantrol URL slash after main domain vis .htaccess **For example ** now my site load like that

www.mysite.com/watch/9jkjndsa9323/

now i want is that possible do something only work 2 slash after main domain like after main domain only word 2 slash

 www.mysite.com/watch/9jkjndsa9323/

a user type

www.mysite.com/watch/9jkjndsa9323/sadk/asd/sad/asd/sad/sad/as/d

but server only show this page to it

 www.mysite.com/watch/9jkjndsa9323/

Try adding this to the htaccess file in your document root (preferably before any other mod_rewrite rules)

RewriteEngine On
RewriteRule ^([^/]+)/([^/]+)/.+/ /$1/$2/ [L,R]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM