Linux / UNIX Tech Support Forum
This is a discussion on .htaccess url rewrite clean URLS within the Web servers forums, part of the Mastering Servers category; Hello All, I have been asked to create a .htaccess redirect. I have never attempted to work with one of ...
|
|||||||
| Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links | ||
|
|
|
||||
|
Redirection and url rewritings are two different things. For e.g. when you visit www.nixcraft.com you will be redirected to nixcraft.com. This is redirection.
Rewriting url will not change url in browser, instead it will internally fetch result from original url. This is done for clean url or for SEO purpose. For e.g. when you visit http://nixcraft.com/web-servers/1326...-redirect.html this url rewritten as /showthread.php?t=13260 using the the pattern. I guess you need 2nd option. Do you know your pattern?
__________________
Vivek Gite Linux Evangelist |
|
||||
|
I actually explained that wrong. I need a url rewriting as you explained. Using the .htaccess file. I need for the browser to take the user to:
Code:
http://itm2108.com/topic/traffic.php? Code:
http://itm2108.com/traffic Hope this makes sense. Thanks for the quick reply. Jaysunn |
|
||||
|
[SOLVED]
Thanks for your help NIXCRAFT. I was working with my senior engineer and I was a bit confused. We added the following to the .htaccess file and it is now working the way we wanted. Code:
RewriteEngine On RewriteBase / RewriteRule ^(.*)/([0-9]+)$ /pages/$2\.php RewriteRule ^/?traffic$ /topic/traffic.php Jaysunn |
|
||||
|
Glad to know it was sorted out ...
__________________
Vivek Gite Linux Evangelist |
![]() |
| Tags |
| .htaccess , apache , httpd , linux , mod_rewrite , rhel |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl / Shell Regex to clean and remove all HTML tags | cosminnci | Coding in General | 1 | 27-01-2009 01:28 AM |
| clean table with cron job | verbatim | Shell scripting | 1 | 09-07-2008 07:11 PM |
| Lighttpd Gallery2 URL Rewrite (.htaccess) SEO Rules | rootadmin | Web servers | 2 | 22-06-2008 06:57 PM |
| /tmp clean directory automatically using tmpwatch | tanachi | Getting started tutorials | 4 | 24-05-2007 10:58 AM |
| .htaccess problems | rcordeiro | Linux software | 4 | 05-07-2006 07:32 PM |