Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-04-2007, 11:41 PM   #1
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Rep: Reputation: 15
Apache rewrite rule help

Hi again all

I find myself in desperate need of some help again...

I have a website, example being When someone hits this site, it gets rewritten as:

I need this to be rewritten as:

I did some research on regular expression, but I just can't seem to get it down.

I'm not using .htaccess files, but am using Virtual Hosts in my httpd.conf file.

The current Virtual Host settings look like this:

#Virtual host for domain --> servername kinetik --> --> TEST project
<VirtualHost *>
#ErrorDocument 401 "/401.html"
#ErrorDocument 403 "/403.html"
ErrorDocument 404 "/404.html"
#ErrorDocument 500 "/500.html"
#ErrorDocument 400 "/400.html"
DocumentRoot "/data01/www/kinetik"
DirectoryIndex index.htm
ErrorLog /var/www/html/kinetik_error.log
TransferLog /var/www/html/kinetik_access.log
RewriteEngine On
RewriteRule ^/web/(.*)$ /web/home/$1 [L]
RewriteCond %{REQUEST_URI} !^/web/home/*
RewriteCond %{REQUEST_URI} !^/(40(1|3|4)|500).html
RewriteRule ^(.*\.htm*)$1 [r=301]
RewriteRule ^(.)$$1 [r=301]
RewriteRule ^/SID-[0-9A-F]-[0-9A-F]/$ $1 [r=301]

I've tried many different combinations of the last RewriteRule, but that SID just keeps on sticking in the URL.

The problem is that the system has recently been configured not to supply SIDs in the URL anymore, but rather via cookies. Now when someone tries to access a URL they may have in their bookmarks containing an SID, they get a 404 error.

Please, any help and/ or ideas welcome.

Thanks in advance
Old 11-05-2007, 11:18 AM   #2
Registered: Nov 2006
Distribution: Lots of Debian
Posts: 165

Rep: Reputation: 32
I can't offer any more help than pointing you to the "Mod rewrite" section of this how-to:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
i need a rewrite rule!help arcow Linux - Enterprise 1 07-03-2007 05:37 AM
Rewrite rule with query string in the pattern string basahkuyup Linux - Newbie 2 10-17-2006 02:06 AM
Exception in mod-rewrite rule Boby Programming 0 01-17-2006 07:40 PM
Exim4 rewrite rule for multiple email addresses Hcman Linux - General 3 10-09-2004 02:46 PM
Help me make this rewrite rule in Apache ganninu Linux - General 8 01-07-2004 08:30 AM

All times are GMT -5. The time now is 12:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration