LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache rewrite rule help (https://www.linuxquestions.org/questions/linux-software-2/apache-rewrite-rule-help-597178/)

kinetik 11-04-2007 11:41 PM

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 :)

esaym 11-05-2007 11:18 AM

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


All times are GMT -5. The time now is 09:35 PM.