1

I'm building a site with multiple versions of the same page. So if the user goes to example.com/?u=user1, they get a custom branded version of the home page using JS which determines the query string and matches that to an image.

My question is how can I get the user to be able to visit example.com/user1 or example.com/start/user1 rather than the query string URL? Is there any way to do this?

I've tried rewrites but it isn't working:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^start/([^/]+)/?$ /?u=$1 [L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/start [NC]
RewriteRule . /index.php [L]

Any help would be appreciated!

user2208768
  • 25
  • 1
  • 8

1 Answers1

-1

I believe this post addresses that question and has the code you'll need. I don't think it's necessary to do this with .htaccess. It would be much easier with JS.

Community
  • 1
  • 1
PapaHotelPapa
  • 687
  • 5
  • 19