Reputation: 712
I am having URL as blow:
http://www.example.com/joi-videos/user_videos/rakesh/index.php
I want to remove "user_videos" from url and URL should be like like below: http://www.example.com/rakesh/index.php
Please help me with this:
I am writing below code but its not working:
RewriteEngine On
RewriteRule ^user_videos/(.*)$ /$1 [L]
Upvotes: 2
Views: 50
Reputation: 786091
Place this rule inside /joi-videos/.htaccess
:
RewriteEngine On
RewriteBase /joi-videos/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^((?!user_videos/).*)$ user_videos/$1 [NC,L]
Upvotes: 0
Reputation: 53
try this one
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ user_videos/$1 [QSA,L]
Upvotes: 1
Reputation: 41249
Try :
RewriteEngine On
RewriteRule ^joi-videos/(.*)/?$ /joi-videos/user_videos/rakesh/index.php [L,NC]
Upvotes: 0