LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-04-2007, 11:41 PM   #1
kinetik
Member
 
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 http://www.kinetik.com. When someone hits this site, it gets rewritten as:
http://www.kinetik.com/web/SID-ABC12...home/index.htm

I need this to be rewritten as:
http://www.kinetik.com/web/home/index.htm


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:

Quote:
#Virtual host for domain kinetik.com --> servername kinetik --> --> TEST project
<VirtualHost *>
ServerAdmin kinetik@kinetik.com
ServerName kinetik.com
#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*) http://www.kinetik.com/web/home/hs.xsl$1 [r=301]
RewriteRule ^(.)$ http://www.kinetik.com/web/home$1 [r=301]
RewriteRule ^/SID-[0-9A-F]-[0-9A-F]/$ $1 [r=301]
</VirtualHost>

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
esaym
Member
 
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: https://help.ubuntu.com/community/fo...er/apache2/SSL
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:22 AM.

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