0

I have dilemma for my .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?user=$1

Example:

When I open http://example.com/david it opened as well.

But if I add slash after username, it won't open, like http://example.com/david/ (note the trailing slash).

2 Answers 2

1

You can use:

RewriteRule ^([a-zA-Z0-9_-]+)/?$ user.php?user=$1

And for css:

css disapears when trying to create clean url's

(Do not accept a solution if it does not work!)

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

Comments

0

Have you tried

RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?user=$1

1 Comment

Hi, I have tried. When I open example.com/david can't open. When open example.com/david <-- with / that opened but the css not function.

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.