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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:50:52+00:00 2026-06-05T05:50:52+00:00

I have a setup that sets variables for the index page, but it also

  • 0

I have a setup that sets variables for the index page, but it also does the same for directories and I don’t want it to do that. Here’s my .htaccess file:

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/(login|images|favicon\.ico|home|about|sitemap|contactus|termsandconditions|privacypolicy|signup|search|careers|error|css|js) [NC]

RewriteRule ^([a-zA-Z0-9]+)$ index.php?name=$1
RewriteRule ^([a-zA-Z]+)/$ index.php?name=$1

RewriteRule ^([a-zA-Z]+)/([a-zA-Z0-9_]+)$ index.php?name=$1&page=$2
RewriteRule ^([a-zA-Z]+)/([a-zA-Z0-9_]+)/$ index.php?name=$1&page=$2

RewriteRule ^php/$ error/

Now, with this setup, if I type in mysite.com/login it will redirect to the index.php page and set login as the name variable. How do I make it to where it ignores the directories? This is frustrating me and I’ve looked through this site for over an hour for an answer and can’t find a similar question (I might suck at that too, though. haha!).

Also, if you look at the last RewriteRule, you can see that I’m trying to redirect any attempt to access my php/ folder to my error/ folder. This is also not working.

  • 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-05T05:50:54+00:00Added an answer on June 5, 2026 at 5:50 am

    RewriteCond only applies to the immediately following RewriteRule. Also, you can combine lines 3&4, and 5&6 respectively, by using /? on the end, which makes the / optional (regex).

    Your file could be similar to this:

    RewriteEngine On
    #the following line will not rewrite to anything because of "-", & stop rewiting with [L]
    RewriteRule ^(login|images|favicon\.ico|home|about|sitemap|contactus|termsandconditions|privacypolicy|signup|search|careers|error|css|js)/?(.*)$ - [L,NC]
    RewriteRule ^php/?(.*)$ error/ [L,NC]
    RewriteRule ^([^/]+)/?$ index.php?name=$1 [L]
    RewriteRule ^([^/]+)/([^/]+)/?$ index.php?name=$1&page=$2 [L]
    

    You may be interested in the Apache Mod_Rewrite Documentation.

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

Sidebar

Related Questions

I have some setup code in my functions.php file that sets permalinks and adds
I have a site setup that is working fine in ie8 and firefox but
I have a setup application that if user clicks the same setup twice, they
I have a method setup that takes about 3-5 seconds to run (because it
I have a setup function that runs onload to add some behaviours to elements.
I have a setup project that installs my app to the typical program files
I have an Setup project that installs App.exe. App.exe depends on 1) A third
I'm running wamp on Vista (Apache v2.2.11) and have projects setup such that http://localhost/projectx
I am making my first program using Java3D. I have setup some transformGroups that
I have setup a basic test app that displays a view containing a label,

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.