1

I have url : example.com/view/?=content

and i want : example.com/view/content

I tried these codes but it doesn't work.

RewriteEngine On
RewriteRule ^/view/(.*)$ /view/?url=$1 [L]

thanks.

2 Answers 2

1

Use :

RewriteEngine On
RewriteRule ^view/(.*)$ /view/?url=$1 [NC,L]

No initial / in RewriteRule left expression in .htaccess

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

1 Comment

Glad to know it worked out, you may mark the answer as accepted by clicking on check mark on top-left of my answer.
0

Remove the leading slash from your rewrite pattern :

RewriteEngine On
RewriteRule ^view/(.*)$ /view/?url=$1 [QSA,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.