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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:13:35+00:00 2026-06-01T18:13:35+00:00

RewriteEngine On RewriteRule ^/showlisting/(.*)$ showlisting.php/$1 [L] RewriteRule ^/listings/(.*)$ listings.php/$1 [L] RewriteCond %{HTTP_HOST} ^mydomain\. RewriteRule

  • 0
RewriteEngine On

RewriteRule ^/showlisting/(.*)$ showlisting.php/$1 [L]
RewriteRule ^/listings/(.*)$ listings.php/$1 [L]

RewriteCond %{HTTP_HOST} ^mydomain\.
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]

ErrorDocument 404 /notfound

In the above, this is what I want to achieve:

  1. I want to forward any URLs such as http://www.mydomain.com/showlisting/my-listing-data/with-more-slashes/and-some-text to show the content of http://www.mydomain.com/showlisting*.php*/my-listing-data/with-more-slashes/and-some-text but with URL masking so that the .php does NOT appear on the browser window.
  2. I also want to append with www when the www is not present in the request for SEO purposes, although I’m not sure how important this is these days.

When I visit http://www.mydomain.com/showlisting/my-listing-data/with-more-slashes/and-some-text however it shows a 404 error, but with the .php added to showlisting, it works fine. Any ideas?

However note that the appending of the www. works fine – that’s not the part I’m struggling with, although I included that part of the code anyway for full analysis.

  • 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-01T18:13:36+00:00Added an answer on June 1, 2026 at 6:13 pm

    Maybe

    RewriteEngine On
    
    RewriteRule ^showlisting/(.*)$ showlisting.php/$1 [L]
    RewriteRule ^listings/(.*)$ listings.php/$1 [L]
    
    RewriteCond %{HTTP_HOST} ^mydomain\.
    RewriteRule ^$ http://www.mydomain.com/ [R=301,L]
    
    ErrorDocument 404 /notfound
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Options +FollowSymLinks RewriteEngine On RewriteRule ^files/(.*) files/index.php RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1
i am using RewriteEngine On RewriteCond %{HTTP_HOST} ^http://mywebsite.com/ RewriteRule (.*) http://mywebsite.com//$1 [R=301,L] RewriteEngine On
i have a .htaccess file RewriteEngine On RewriteCond %{HTTP_HOST} ^localhost/host RewriteRule (.*) http://localhost/host/$1 [R=301,L]
I have the following .htaccess rule: RewriteEngine on RewriteRule ^(.*) http://www.server2.com/index.php?action=$1 I need to
I have this 301 redirect rule for Apache: RewriteEngine On RewriteRule ^park.php?park_id=3 http://hiking.comehike.com/outdoors/parks/park.php?park_id=3 [R=301,L]
RewriteEngine on RewriteRule ^/(dir1|dir2|dir3)/(.*)$ /targetfile.php [R,L] http://www.somesite.com/dir1 -> http://www.somesite.com/targetfile.php http://www.somesite.com/dir2 -> http://www.somesite.com/targetfile.php http://www.somesite.com/dir3 ->
I have the following .htaccess file: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^mydomain.com RewriteRule
Why isn't this working? RewriteEngine on RewriteRule ^/filter/([A-Za-z0-9])*$ /index.php?filter=$1 Trying to get this: http://www.site.com/filter/whatever-is-here
RewriteEngine On RewriteRule ^/ai?$ /Market/publish.jsp [QSA,L,PT] RewriteRule ^/ar?$ /Market/MailDispatch [QSA,L,PT] RewriteCond %{HTTP_HOST} !^web\.example\.com [NC]
I have the following code: RewriteEngine on RewriteRule ^example/? test.php When I hit www.example.com/example

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.