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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:40:14+00:00 2026-05-25T18:40:14+00:00

I am working on a website and i am faced with a big issue

  • 0

I am working on a website and i am faced with a big issue is:

  1. i want all my traffic http://www.example.com/ to http://example.com or http://www.example.com/folder/ to http://example.com/folder/

(Note: the key thing here is it can work for infinite number of subfolders or pages as far as its the same root domain)

  1. I want to rewrite http://example.com/name to http://example.com/folder/page.php?page=$name except for some urls like http://example.com/css which i will specify.
    This time around, the url still shows http://example.com/name which is the page visited but really page has been rewritten. This is unlike the first scenario that that changes the url in the address bar.

Now this is what i have:

<IfModule mod_rewrite.c>
   Options +FollowSymlinks
    Options -Multiviews
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

   RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
   RewriteCond %{REQUEST_URI} !^/(candidates|css|employers|layout|pics|securimage)/?$

   RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
   RewriteRule ^([^/]+)/?$ employers/page.php?page=$1 [L]
</IfModule>

The issues am having with what i have above are:

  1. It does not redirect http://www.example.com/ to http://example.com.

  2. It seems to rewrite well for http://www.example.com/name but when i have a url with one of the exceptions like http://example.com/css it changes the url to http://example.com/css/?page=css.

Please how can i fix this.

Thank you so much.

  • 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-25T18:40:15+00:00Added an answer on May 25, 2026 at 6:40 pm

    You have to separate your conditions ans rewrite rules:

    For the www subdomain:

    RewriteCond %{HTTP_HOST} ^www.example.tld$
    RewriteRule ^(.*) http://example.tld/$1 [QSA,R=301]
    

    then for the QSA redirection, except if the file exists:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/]+)/?$ employers/page.php?page=$1 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started using ModX yesterday. Prepared my multilingual website using this tutorial: http://www.multilingual-modx.com/blog/2011/multilingual-websites-with-modx-and-babel.html .
When working on my website www.monkey-touch.com I started using a custom font for the
Im working on a website (html,css,javascript, ajax, php,mysql), and I want to restrict the
I have a website that is working properly.I dont know when I do Domain-name.com/images
I have a working website on a pre-production server, all functions are responding correctly.
please read all of this before commenting. I'm currently working on a large website
Hi Hi have a working website on localhost that I want to move online.
hey i guys i want help from you. i am working on website project,
How can i turn http://domain.com/foo/bar.jpg into http://domain.com/bar while keeping the rest of the website
Working on a website that has Employee and Branch entities, using a database table

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.