caiocafardo
caiocafardo

Reputation: 196

Change index URL with parameters using htacess

I want my URL index to work with or without parameter at the end:

mysite.com need to works exactly the same as mysite.com/test

Because I need to get the test variable with GET. But the site needs to behave equally with or without this parameter. I try:

RewriteRule (.*) index.php?var=$1

But it breaks the links to the exters files (css, jquery, etc.).

Upvotes: 0

Views: 178

Answers (1)

caiocafardo
caiocafardo

Reputation: 196

I got it like this:

RewriteRule ^test/(.*) index.php?var=$1

Upvotes: 1

Related Questions