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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:21:56+00:00 2026-05-26T03:21:56+00:00

Here is the url that I have that works: example.com/php/statePage.php?region_slug=new-york-colleges Here is what I

  • 0

Here is the url that I have that works:

example.com/php/statePage.php?region_slug=new-york-colleges

Here is what I am trying to get the url to appear as:

example.com/new-york-colleges.html

I have tried several things so far and I think I am getting close but this is my first PHP / MySQL site and first time using .htaccess.

Here is my .htaccess so far:

RewriteEngine on

RewriteRule ^/([^/.]+).html?$ php/statePage.php?region_slug=$1 [L]

Any help would be greatly appreciated. If you could explain what I was missing or what I did wrong, that would help me more… I am trying to learn how to do this and simply giving me the cut and paste method will only help me today.

THANK YOU, this means a lot to me!

  • 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-26T03:21:57+00:00Added an answer on May 26, 2026 at 3:21 am
    RewriteEngine on
    RewriteRule ^([^/\.]+)\.html/?$ php/statePage.php?region_slug=$1 [L]
    

    Two things to point out:

    When . is used in rewrite syntax, it represents any character. So your current rule says replace anything that’s NOT any character, followed by ‘.html’. To work around this, escape your dot like so \.. There are several special characters in rewrite syntax such as this. It would benefit you to pay attention to them.

    Second, I’m not sure if this is rewrite canon or not, but I’ve never personally used forward slashes at the start of a rewrite rule before, and that may or may not impact the rule itself. Any user with a clarification on this is encouraged to reply.

    EDIT: The following characters are marked as special characters in rewrite syntax (and all regular expressions, for that matter), and as such, need to be escaped with a backslash \ in order to be used literally – [\^$.|?*+()

    Also, you may find this reference useful in further understanding the correct syntax for regular expressions.

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

Sidebar

Related Questions

This is my code, $.ajax({ type:get, //this doesn't work //url:'http://example.com/json.php', //But this works url:'http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?',
I used this <a href='download.php/download=true' >download link here</a> so the url now is example.com/download.php/download=true
Here's an example of what I'm trying to do. Turn this: http://example.com/products/ into this:
I have a web site with URL http://myapp.herokuapp.com/welcome.php and I am redirecting a domain
So on my site (https://example.com) I have a page that parses the last.fm API
I have a search page located at http://www.example.com/search_result.php , and I'm mod_rewriting it to
Here's the scenario. I'm using a url rewriter that allows me to specify patterns
Here is the function that i am using: $('.urlz').click(function (event) { event.preventDefault(); var url
Here's my regex code: preg_match_all('/background[-image]*:[\s]*url\([|\']+(.*)[|\']+\)/', $css, $matches, PREG_SET_ORDER); It looks for CSS that looks
Here's my URL: https://maps.googleapis.com/maps/api/place/search/xml?location;=41.983333,-87.766666&radius;=5000&sensor;=false&type;=doctor&name;=DPM&key;= mykey I get a request denied response. I have activated

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.