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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:55:19+00:00 2026-06-13T07:55:19+00:00

Possible Duplicate: mod_rewrite, php and the .htaccess file Would like this to happen in

  • 0

Possible Duplicate:
mod_rewrite, php and the .htaccess file

Would like this to happen in the .htaccess file.
to rewrite

index.php?pagetype=name

to

/pagetype/name/

do this for all pagetypes so

?user=name
?post=number
?life=sucks ... etc

but would like to exclude

/css/
/images/
/js/
/php/
/template/

so the variable links still work.

I am guessing this should work but I want it in it’s most simplest form so I don’t have to change the .htaccess file everytime I add a pagetype.

I did a search for this but didn’t find anything helpful.

The site will only have one physically accessed file: index.php then the rest are processed via $_GET commands

  • 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-13T07:55:20+00:00Added an answer on June 13, 2026 at 7:55 am

    Just for the example you specified, the simplest approach would be:

     RewriteCond  %{REQUEST_URI}   !^/(css|images|js|php|template)/
     RewriteRule  ^(\w+)/(\w+)/?$  index.php?$1=$2  [QSA,L]
    

    (The RewriteCond could be written as negative lookeahead in the Rule instead of course.)

    See also the mod-rewrite tag wiki for further howtos.

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

Sidebar

Related Questions

Possible Duplicate: Rewrite all queries to not need the .php extension using a mod_rewrite
I use mod_rewrite/.htaccess for pretty URLs. I forward all the requests to my index.php,
Possible Duplicate: Remove .php extension with .htaccess I'm trying to hide the .php file
Possible Duplicate: Query Strings & Mod ReWrite I have written a .htaccess file which
Possible Duplicate: mod_rewrite php mysql What I want to do is change this: www.site.com/profile.php?id=1
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:
Possible Duplicate: Mod Rewrite and Using PHP’s GET for URL’s When not Following the
Possible Duplicate: What literal characters should be escaped in a regex? RewriteRule ^profile/[A-Za-z_-\d\^\.]/*$ ./index.php?page=showuser&username=$1
Possible Duplicate: C# driver development? I would like to know if I can do
Possible Duplicate: How to successfully rewrite old mysql-php code with deprecated mysql_* functions? I

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.