2

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]

3 Answers 3

1

try this one

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^([^/]+)/?$ user_videos/$1 [QSA,L]

Sign up to request clarification or add additional context in comments.

Comments

0

Try :

RewriteEngine On
RewriteRule ^joi-videos/(.*)/?$ /joi-videos/user_videos/rakesh/index.php [L,NC]

1 Comment

using this it is fourcefully foing to example.com/joi-videos/user_videos/rakesh/index.php
0

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]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.