Reputation: 7
I am a little confused when it comes to .htaccess . So I have a project and in the project, I have everything organized into sub folders. The way I have .htaccess written right now, it is only pulling the first portion of my url. How can I get the second portion of the URL? www.website.com/profile/12345 . I am trying to get the numbers but I am currently only getting up to profile. The numbers being an ID number from the database.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA, L]
Upvotes: 1
Views: 24
Reputation: 1533
The 'first portion' of your URL is called the Host Name i.e. www.website.com
The 'second portion' of your URL is called the Path i.e. /profile/12345
You are trying to get numbers, is nonsense, it does not make sense.
Apache rewrite rules do not get numbers, rewrite rules take one URL and rewrite it into another URL based on defined conditions/criteria.
Upvotes: 1