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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:59:08+00:00 2026-05-16T10:59:08+00:00

I am trying to get mod_rewrite to work with my site but for some

  • 0

I am trying to get mod_rewrite to work with my site but for some reason it’s not working.
I’ve already entered code into my .htaccess file to redirect non-www to www so I know mod_rewrite is working in general.

The url’s I’m trying to change are example.com/index.php?p=home so the new URL would be example.com/page/home

However, when I try this code I simply get a 404 telling me that /page/home doesn’t exist.

Options +FollowSymLinks

RewriteEngine on

RewriteRule index/p/(.*)/ index.php?p=$1
RewriteRule index/p/(.*) index.php?p=$1

Can anyone help me out please?

  • 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-16T10:59:09+00:00Added an answer on May 16, 2026 at 10:59 am

    Your pattern doesn’t match your example URL. Assuming your example URL was correct, you wanted this instead:

    Options +FollowSymLinks
    
    RewriteEngine on
    
    # We want to rewrite requests to "/page/name" (with an optional trailing slash)
    # to "index.php?p=name"
    #
    # The input to the RewriteRule does not have a leading slash, so the beginning
    # of the input must start with "page/". We check that with "^page/", which
    # anchors the test for "page/" at the beginning of the string.
    #
    # After "page/", we need to capture "name", which will be stored in the
    # backreference $1. "name" could be anything, but we know it won't have a
    # forward slash in it, so check for any character other than a forward slash
    # with the negated character class "[^/]", and make sure that there is at least
    # one such character with "+". Capture that as a backreference with the
    # parenthesis.
    #
    # Finally, there may or may not be a trailing slash at the end of the input, so
    # check if there are zero or one slashes with "/?", and make sure that's the end
    # of the pattern with the anchor "$"
    #
    # Rewrite the input to index.php?p=$1, where $1 gets replaced with the
    # backreference from the input test pattern
    RewriteRule ^page/([^/]+)/?$ index.php?p=$1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get some rewriterules working. Htaccess is enabled, the mod-rewrite loads. It
I'm trying to get my .htaccess file to work from the root, but also
I'm trying to get mod_rewrite working with the following URLs: /events.php?view=details&id=$var /events.php?view=edit&id=$var Obviously my
I'm trying to get .htaccess to rewrite urls for my site. For example: /Lessons/PhrasalVerbs/PVList/bringup
So I'm trying to get mod_rewrite to work, using Apache2.2 on windows 7 I'm
I'm trying to get Django to run through mod_wsgi on Apache2.22 but I'm getting
I am trying get Struts 2 and Tiles to work and I am using
I have a site where I am trying to change the urls using mod_rewrite
for some days now I have been trying to make a simple mod_rewrite rule
I am trying to enable mod_write's rewrite URL and am not able to get

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.