2

Alright I seem to hit rock bottom, and can't figure this out.

I've googled and read several solutions here, and can't seem to implement them in my situation.

This is probably an .htaccess solution, which is another reason why I'm asking the question because I don't know how to come up with a solution myself.

So I'd like to take a segment/parts of segment out of my url.

domain.com/one-day/one-day-denver and like it to be - domain.com/denver

I'm using structure to give me my url structure. I could recreate the page and make it name how I want it, but it would defeat my relationships that I have with playa.

Whats a quick and dirty way that I could write in my .htaccess?

I currently have these rules on there.

<IfModule mod_rewrite.c>
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule ^ http://%1%{REQUEST_URI} [R=301]
</IfModule>

and

RewriteCond $1 !^(notes|api|cms|fw|themes|uploads|favicon\.ico|robots\.txt|index\.php|speakers\.json|ads|email) [NC]
RewriteRule ^(.*)$ index.php?$1 [L]

How do I write it to remove what I asked about and still and have the inner workings still poiting to /one-day/one-day-denver

I appreciate any help.

Thanks!

0

1 Answer 1

1

It depends on why you're doing this I think. It seems like you're adding extra info in to the entry so the client can distinguish between entries inside a Playa field, is that correct? But you want your URLs to be different. If that's the reason just change the URL to denver and keep the title One Day Denver. Playa will display the titles.

Alternatively add 301 redirects in your htaccess, so domain.com/denver maps to domain.com/one-day/one-day-denver. This will show the 3 segment URL to everyone though but you can keep your URLs short.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.