1

I've started writing my own PHP MVC Framework and everything is working well expect custom URLs.

I want http://example.com/featured to be redirect to index.php?tab=2&url=home/index

and that's my .htaccess file

RewriteEngine On

# url should not point a directory or a file.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

# redirect all requests to index.php
RewriteRule ^featured$ index.php?tab=2&url=home/index [NC]
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

but it's not working. Any ideas why it would not be working?

1 Answer 1

1

I've finally figured it out by myself.

I put RewriteRule ^featured$ index.php?tab=2&url=home/index [NC] above RewriteCond's and it worked.

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

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.