adam
adam

Reputation: 93

htaccess remove part of the url

I have urls structured like this:

 /!#/pretty-url/

I need to remove the !# so the urls will look like this:

/pretty-url/

What would be the correct .htaccess rule to do this?

Upvotes: 1

Views: 242

Answers (1)

baynezy
baynezy

Reputation: 7066

When you have a # in the URL then that is a named anchor. The browser does not send anything to the right of a # to the server. This means that all the rewrite engine is seeing is:-

/!

If you want your URLs to look like this then you are going to need to use JavaScript to get the relevant content via AJAX.

Upvotes: 1

Related Questions