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 3442938
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:43:49+00:00 2026-05-18T08:43:49+00:00

Okey, so this is my problem. I want to use mod_rewrite to make nice

  • 0

Okey, so this is my problem.
I want to use mod_rewrite to make nice looking urls for my site.

I want them all to have good looking url like http://www.mypage/tennis or http://www.mypage/soccer instead of http://www.mypage/?page=tennis and http://www.mypage/?page=soccer

And with the following rules i can achive this:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule .* index.php [L]

So now if I type in http://www.mypage/soccer my PHP script reads this url and does it’s magic translating this to $_GET[‘page’] = soccer. All this works fine!

Problem is if I would type the URL http://www.mypage/soccer/ all of a sudden every linked css or image cannot be found by the website, since it now looking in the none existing folder /soccer/ off course.

How do I make a rewrite rule that transforms /soccer/ to /soccer or any other /blabla/ to /blabla

Hope my question is clear! Also if anyone have any good pages where I can learn more regular expressions i would be very happy!

  • 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-18T08:43:50+00:00Added an answer on May 18, 2026 at 8:43 am

    Try this:

    RewriteRule ^([A-Za-z0-9-]+)/?$ ?page=$1 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okey, this is my problem. I have one service class where Ive managed to
Okey, so this is my problem. I have a page structure saved into a
I have a template class where I want to use objects of that class
Okey. Here's what I want to do: I have a windows application that sorts
Okey this is really strange. I have this script which basically downloads bunch of
I'm trying to download multiple files using IntentService. The IntentService donwloads them okey as
I have a problem posting file via ajax jQuery function. I have something like
Okey, here it goes. I have a block of code that repeats it self
Lets say i have a Shape object that has a constructor like this: Shape(
I have a question about handling my models. I get all confused. When I

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.