View previous topic :: View next topic |
Author |
Message |
sonofcolin -
Joined: 18 Nov 2004 Posts: 23
|
Posted: Sun Sep 23, 2007 8:26 pm Post subject: Apache rewrite --> Abyss help |
|
|
I'm trying to transfer some apache rewrite rules to Abyss:
Code: | RewriteCond %{QUERY_STRING} ^cPath=133$ [NC]
RewriteCond %{REQUEST_URI} /index\.php$ [NC]
RewriteRule ^.*$ http://www.domin.com/index.php?cPath=133_167 [R=301,L] |
Can't seem to get this working under Abyss. Any help appreciated |
|
Back to top |
|
|
sonofcolin -
Joined: 18 Nov 2004 Posts: 23
|
Posted: Mon Sep 24, 2007 7:57 pm Post subject: |
|
|
Ok. I need the professional version to do this. I was just using the free version to test. I'll contact support to see if they can give me a look at the pro version of the rewrite engine to see if it's possible to move all of our apache stuff. |
|
Back to top |
|
|
admin Site Admin
Joined: 03 Mar 2002 Posts: 1295
|
Posted: Wed Sep 26, 2007 12:31 am Post subject: |
|
|
sonofcolin wrote: | Ok. I need the professional version to do this. I was just using the free version to test. I'll contact support to see if they can give me a look at the pro version of the rewrite engine to see if it's possible to move all of our apache stuff. |
The rewrite engine is the same on both X1 and X2. So you can use X1 (the personal version) with the converted rules.
To be able to help you with the full convertion, we need to have the line starting with RewriteBase. If there is no such line in the .htaccess file you're converting, please let us know what the URL of the directory where the .htaccess is located. _________________ Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com |
|
Back to top |
|
|
sonofcolin -
Joined: 18 Nov 2004 Posts: 23
|
Posted: Wed Sep 26, 2007 9:16 pm Post subject: |
|
|
admin wrote: |
To be able to help you with the full convertion, we need to have the line starting with RewriteBase. If there is no such line in the .htaccess file you're converting, please let us know what the URL of the directory where the .htaccess is located. |
This is actually taken from an apache host.conf file not .htaccess. The full condition is:
Code: | <IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog /var/log/httpd/rewrite
RewriteLogLevel 9
RewriteCond %{QUERY_STRING} ^cPath=133$ [NC]
RewriteCond %{REQUEST_URI} /index\.php$ [NC]
RewriteRule ^.*$ http://www.domain.com/index.php?cPath=133_167 [R=301,L] |
I have a bunch of queries which need to be modified by adding an extra 3 digits to the query. The above example will modify query fwhich ends with cPath=133 to cPath=133_167. As this will work across all domains, I want to use the URL rewriting facility. |
|
Back to top |
|
|
admin Site Admin
Joined: 03 Mar 2002 Posts: 1295
|
Posted: Fri Sep 28, 2007 2:12 am Post subject: |
|
|
sonofcolin,
You could implement a carbon copy URL rewriting rules of the original ones found in the host.conf file. But we have simplified them a little bit and made them more general.
So here is are the instructions for the first rule:
* Open the URL Rewriting dialog in the console
* Press "Add" in "URL rewriting rules"
* Enter in "Virtual Path Regular Expression":
This means that the rule has to apply to any request which virtual path is exactly /index.php
* Next, press "Add" in "Conditions".
* Set "Variable" to "QUERY_STRING"
* Set "Operator" to "="
* Set "Value" to:
* Uncheck "Case Sensitive"
* Press "OK"
* Set "If this rule matches" to "Perform an external redirection"
* Set "Redirect to" to:
Code: | /index.php?cPath=133_167 |
Note that we have not included the full URL with the leading http://..... as in the host.conf file. Abyss Web Server can deduce that information with no problem and you get the same result (with fewer keystrokes).
* Uncheck "Append Query String". Actually this is important in your rule since it already manipulates the QUERY_STRING so you don't want the old one to get appended automatically (which is the default behavior).
* Set "Status code" to "301 - Moved Permanently".
* Press "OK".
Now you have to repeat the above steps to declare the rules for the other cases. _________________ Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com |
|
Back to top |
|
|
sonofcolin -
Joined: 18 Nov 2004 Posts: 23
|
Posted: Fri Sep 28, 2007 3:00 am Post subject: |
|
|
Just wanted to say a big thank you to the support staff. The above example did answer my questions and has allowed me to build upon this. Great support and a great product. |
|
Back to top |
|
|
|