Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to configure a mod_rewrite for CMSMS?

Posted on 2008-10-28
3
Medium Priority
?
547 Views
Last Modified: 2013-12-09
I'm using a CMS (CMSMS) that formats the links with the following structure when configured for mod_rewrite :
http://domain.tld/parent/content

This parent/content URL scheme is automatic and cannot be deactivated.

I've modified the CMS to take a language parameter into account, so now the URLs look like this :
http://domain.tld/langage/parent/content

What rewrite_rule should I use, knowing that when not using mod_rewrite, my CMS accepts these two arguments only :
index.php?hl=language&page=content
0
Comment
Question by:CPL593H
  • 2
3 Comments
 
LVL 27

Expert Comment

by:caterham_www
ID: 22823712
How does your current rewriteRule look like?

Basically it should look like
RewriteEngine on
RewriteRule ^([^/]+)/parent/(.*) /index.php?hl=$1&page=$2 [L]

Open in new window

0
 

Author Comment

by:CPL593H
ID: 22829244
Note that in CMSMS, the parent/content portion of the URL is automatically generated by parsing the page order and checking a page's parent.
When not using mod_rewrite, the parent/content mode is not used, only the content is being passed as an argument.

These are my current rewriteRules :
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^([^/]+)/(.*)$ index.php?page=$2&hl=$1 [QSA]

Open in new window

0
 

Accepted Solution

by:
CPL593H earned 0 total points
ID: 22848265
I found a solution to my problem.  It appears that the rewriteBase was not set in my .htaccess; thus redirecting URLs to the wrong directory.  The above RewriteRule is therefore correct and works very well.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question