Htaccess Rewrite

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 1357 Views - Last Post: 16 February 2018 - 10:42 AM

#16 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2249
  • View blog
  • Posts: 6,877
  • Joined: 15-January 14

Re: Htaccess Rewrite

Posted 16 February 2018 - 10:42 AM

Quote

I gave a girl $150 dollars and that's what she gave me, a bug that re-writes every url to profile.

Well, what requirements did you give her? The rule does what you want, it just doesn't stop there. If you didn't tell her that there are going to be a lot of URLs that should not be affected by these rules, and some examples of what those other URLs are or what the rules are, then you left out vital information.

Quote

It works in the tester, but not sure if it's rewriting every url.

That's what it looks like to me:

RewriteRule ^(.*)$ /profile/profile.php?username=$1 [QSA]

That says match the entire URL, and replace it with the path to the profile page. According to the manual, the QSA flag will append any existing querystring to the new URL, it will combine them.

Quote

All I know is that it gives me internal errors on the server.

That's what the Apache error log is for.

Quote

I wrote myself but it's erroneous.

I would leave out the host and only include the path to the file that you want to redirect to, just to make sure it's not going to do an external redirect with that.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2