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

  • Home
  • SEARCH
  • 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 8574901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:34:46+00:00 2026-06-11T19:34:46+00:00

I have troubles with mod_rewrite. I have wordpress site located in ‘wp’ directory. It

  • 0

I have troubles with mod_rewrite.

I have wordpress site located in ‘wp’ directory. It is accessible as http://localhost/wp/

There is page http://localhost/wp/sample-page/ on the site.

I want to make this page open with url http://localhost/wp/sample-page-2/ without redirect.

Here is what in .htaccess file:

RewriteEngine On
RewriteBase /wp/
RewriteRule ^sample-page-2/$ sample-page/ [L]

But I’m getting 404 error.

Could somebody explain me what I’m doing wrong?
Thanks in advance.

UPD:

@soju: Well, “sample-page-2” – is just example

  1. It is not a page/post in worpress sence.
  2. Actually I tried to add one section to the url. E.g. http://localhost/wp/sample-page/section/. And this rule RewriteRule ^sample-page/section/$ sample-page/ [L] didn’t work. Then I decided to “simpliyfy” url(“sample-page-2” instead of “sample-page/section”) – no success.

UPD2

BTW, redirect RewriteRule ^sample-page-2/$ sample-page/ [R=301,L] works

  • 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-06-11T19:34:48+00:00Added an answer on June 11, 2026 at 7:34 pm

    I suppose wordpress rewrite rules are after your own rule, so you should remove [L] option to let wordpress handle sample-page url

    EDIT about UPD2 : Well, it works with a 301 redirection, but you said you don’t want redirection ?

    You can add a filter on rewrite_rules_array to make your own rewrite rule, take a look at example on codex : http://codex.wordpress.org/Class_Reference/WP_Rewrite#Examples

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

Sidebar

Related Questions

I have troubles using a foreign protocol in Objective-C. Is there any other solution
I'm having some troubles with mod_rewrite. On my index page (index.php) I show a
I have troubles with the following database design (simplified for the example). It allows
I have troubles animating a StackPanel with the VisualStateManager . VisualStateManager.GoToState() accepts a Control
I'm writing an MPI C program. I have troubles debugging it, because whenever I
I have some troubles with my school project. I have a class: #include Group.h
I have some troubles with plotting the figure. I have a file with some
I have some troubles mapping a JSON Array to RestKit. This is what the
I have some troubles with getting the data from the website. The website source
I have some troubles with a method having a typed List parameter, inherited from

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.