• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

htaccess file not working - need assistance.

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^airport/(.+)$ index.php?state=$1 [nc]

I'm trying to make http://www.synapticsurge.com/airport/RI/ go to http://www.synapticsurge.com/airport/index.php?state=RI

It's not working.. and I've been busting at it all day.
0
dprundle
Asked:
dprundle
  • 2
1 Solution
 
WodCommented:
Try this:


RewriteRule ^/airport/(.*)$ http://www.synapticsurge.com/index.php?state=$1 [NC]

Open in new window

0
 
dprundleAuthor Commented:
Ok I tried that but it's still not working.

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^(..)\/$ index.php?state=$1 [nc]
RewriteRule ^(..)\/(.+)\/$ index.php?state=$1&city=$2 [nc]
RewriteRule ^(..)\/(.+)\/(.+)\/$ index.php?state=$1&city=$2&airport=$3 [nc]


For Example,
If it is http://mysite.com/ST/City Name/Name of Airport/ it breaks everything because of the spaces.  It also appears that the .+ grabs the next / in the URL.
0
 
dprundleAuthor Commented:
I figured it out thanks to your help.

Instead of (.+) I used the opposite (^/) and it worked.. points go to you m8
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now