Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4231852
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:01:18+00:00 2026-05-21T02:01:18+00:00

I have been playing with mod_rewrite using .htaccess to translate some directories – for

  • 0

I have been playing with mod_rewrite using .htaccess to translate some directories – for purposes of both improved SEO and also to produce friendlier/more memorable URLs.

The only problem I can’t crack at the moment is with trailing slashes. The behavoir I want is that you should be able to access the link with or without a trailing slash, just to cut down on missed traffic.

My real url is as:

http://www.mydomain.com/shipyard/index.php

I would like people to be able to access it via:

http://www.mydomain.com/shipyard/ 
http://www.mydomain.com/shipyard
http://www.mydomain.com/ships/ 
http://www.mydomain.com/ships 

Of course, the top two are covered because thats actually a real and accessible URL, but I plan to tell Google that the best way to get at the page is using /ships (without having to move directories, break existing links etc).

The best I came up with so far was:

RewriteRule ^ships/$ /shipyard/index.php [L]
RewriteRule ^ships$ /shipyard/index.php [L]

However I just KNOW that i’m using two lines where only one is needed, but whatever I tried, I couldn’t get the one! I know i’m missing something incredibly basic and/or obvious, but I need a pointer… Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:01:19+00:00Added an answer on May 21, 2026 at 2:01 am
    RewriteRule ^ships(/)?$ /shipyard/index.php [L]
    

    This means that the slash may or may not be present.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been playing around with the MVP pattern using winforms for the last
I have been playing around with NSURLConnection. Now I'm trying to grab some data
I have been playing with Wordpress and jQuery - both new to me. The
I have been playing with Node.js for some time. I have the following piece
I have been playing with server side sorting/paging using YUI DataTable, and everything is
I have been playing around with boost::signals2 for learning purposes lately, and I was
I have been playing at work with some very very large sets of data,
I have been playing with some of Apple's example code for customizing UITableViewCells. I
I have been playing around with some debugging and wrote some C code that
I have been playing around with writing some simple card games in Python for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.