<![CDATA[ SEO friendly URLs with IIS - My Forums]]> https://forums.modx.com/thread/?thread=17127 <![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=5#dis-post-441730
With the help of my tech buddy, and your advice, we did the following to make Search Engine Friendly URL's work in IIS (free). I don't know IIS but these are the steps I remember my mate taking:

1. Install URL Rewrite Module onto server (we have remote access and control over a virtual private server)

2. Once installed, follow these instructions: http://www.iis.net/learn/extensions/url-rewrite-module/importing-apache-modrewrite-rules - I seem to remember my mate skipping straight to the 'Convert mod_rewrite Rules' instructions - but don't quote me on that!

3. Import the MODX .htaccess file. The MODX .htaccess file has most of the stuff commented out by default. We left it that way as we were only concerned with the 'friendly url' part of it, which is not commented out by default.

4. Note: URL Rewrite didn't successfully import the 'URL base' segment, (whatever that is) but we simply commented it out on the actual user interface of URL Rewrite and finished the import

> Then in MODX site settings, we enabled 'friendly URL's' and 'strict friendly URL's'

> Finaly in each MODX resource that you have, fill in the 'resource alias' field with whatever u want the URL to look like.

Seems to work so far, and forms are processing OK

Kind regards

Asaf]]>
asaffialkov Oct 29, 2012, 12:27 PM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=5#dis-post-441730
<![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=5#dis-post-419067

http://www.iis.net/download/URLRewrite]]>
patrickc Apr 06, 2012, 09:24 AM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=5#dis-post-419067
<![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-402411
I know it's working because it's not: no such thing as http://www.65.444.32.117/

Once I get the site launched I can fill out the Friendly URLs part, but for now I have to wait and I know that's not helpful for this thread.]]>
ultrasef Dec 05, 2011, 10:41 AM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-402411
<![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93197 Quote from: sottwell at Dec 01, 2010, 06:05 PM

1. That’s because the main index (home) page is set to be your "not found" page in your site’s configuration. You can modify the usual MODx "404" behavior with a plugin using the OnPageNotFound event (or whatever that event is called in the version you’re using).

2. Since all resources are accessed from the main MODx index.php file, as far as I know there’s no way to do that. You can, however, configure FURLs to use paths based on the resource tree structure, for example you could have mysite.com/news/august/big-august-sale.html

Re your point #1, thanks - I’ve got it now.

I’m still really struggling with point 2 though. I already have FURLs configured to use paths based on the resource tree structure (really nice). I would like "mydomain.com/news" to resolve to "mydomain.com/news/index.html"

Web host already looks in subdirectories for a set of files (index.html or index.php, etc.), however since moving my site to ModX and implementing the following rule:

RewriteRule ^/(?!(?:manager|assets)/)(.*)\.php(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]


This isn’t happening any more. (It’s an issue because I have personally invested in marketing that points people to mysite.com/subdir). I do already have a resource under the "subdir" container with the url-alias set to "index" and as you can see my Friendly URL extension is .php

So I’m guessing it’s just a case of modifying my htaccess file (see my post where I’ve included my current htaccess file above) which must be currently preventing this.

Any help greatly appreciated.]]>
hazymat Dec 01, 2010, 06:07 PM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93197
<![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93196
2. Since all resources are accessed from the main MODx index.php file, as far as I know there’s no way to do that. You can, however, configure FURLs to use paths based on the resource tree structure, for example you could have mysite.com/news/august/big-august-sale.html]]>
sottwell Dec 01, 2010, 12:05 PM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93196
<![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93195
Can anyone help with my IIS / ModX FURLs issue?

Please see my post (see 2 above) - I don’t need help with the first point as I’ve now ported most of my site over to ModX and switched on FURLs and the htaccess rule, so there’s no going back!

But if anyone could look at the htaccess I posted above and help with the following points:



  • If I enter into my address bar mysite.com/blah/blah/blah/blah.php even if that path and page doesn’t exist within ModX, it shows the contents of my index page ... but keeps that in the address bar. Is there any way I can prevent this? Even if it doesn’t show a 404 error, if it just automatically redirects the page to /index.php and shows that in the address bar - can this be done?
  • Is there any way ModX can support the use of entering a path to get to a certain address? e.g. let’s say I enter mysite.com/faq, this would automatically redirect to mysite.com/faq/index.php - in the same way a web server would automatically assume this if you entered a subdirectory of a site?

If I’ve missed the answer to one of these questions on another thread, please let me know - although I have searched high and low!

Thanks.]]>
hazymat Dec 01, 2010, 10:28 AM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93195
<![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93194
...........................................

Forget using ISAPI did not work for me.

I used a piece of software called IIS Mod-Rewrite Pro and worked a charm. You do not even need to mess around with any .ini files works straight off with the .htaccess file that comes with the modx install.

...........................................

Hi There,

I have just got ISAPI set up and done the .ini .htaccess files.

The website is working okay on the front end, no problems there.

But now the admin does not work. The menus are there and everything but nothing loads. As soon as I delete the .htaccess file it works fine. Is there a way to make the rewrite rule ignore the manager folder.

All hep is much appreciated.]]>
Minikoopa Nov 15, 2010, 06:05 AM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93194
<![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93193
My .htaccess file (in wwwroot) looks like this (I nabbed an example from above, and changed the .html to .php to suit my needs):


RewriteEngine On
RewriteCompatibility2 On
RepeatLimit 32
RewriteBase 

#  Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule ^/httpd(?:\.ini|\.parse\.errors).*$ / [NC,F,O]
#  Block external access to the Helper ISAPI Extension
RewriteRule ^.*\.isrwhlp$ / [NC,F,O]

RewriteRule ^/(?!(?:manager|assets)/)(.*)\.php(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]



... and the basic URL rewriting feature of ModX is working for me.

However I now have three problems:


  • I have existing pages in the root of my site which I need to continue to work whilst I migrate my site into ModX. e.g. mysite.com/faq.php - the URL remains correct in the address bar of my browser but it shows the contents of my ModX start page (/index.php). I need to edit my .htaccess to account for this. Even if I put in exceptions for each page name manually, it’s fine for now
  • If I enter into my address bar mysite.com/blah/blah/blah/blah.php even if that path and page doesn’t exist within ModX, it shows the contents of my index page ... but keeps that in the address bar. Is there any way I can prevent this? Even if it doesn’t show a 404 error, if it just automatically redirects the page to /index.php and shows that in the address bar - can this be done?
  • Finally is there any way ModX can support the use of entering a path to get to a certain address? e.g. let’s say I enter mysite.com/faq, this would automatically redirect to mysite.com/faq/index.php - in the same way a web server would automatically assume this if you entered a subdirectory of a site?

Can anyone assist me with the above?

Hope that makes sense, would really appreciate your input. The first point is the most important one for me right now as I port my site to ModX!

Many thanks,

Mat

p.s. I’m using ModX Evo right now.]]>
hazymat Oct 23, 2010, 05:21 PM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93193
<![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93192 Quote from: neilp123 at Aug 20, 2010, 11:42 AM

Hi Mark,

Were you able to get FURLs working with Revolution?

I have a solution currently working with Evolution, but this doesn’t seem to with with Revolution.

Still searching...

Just echoing...

If anyone has a tip to get FURLs with MODx Revolution working I would be over the moon laugh

Thanks
jj]]>
jimboejones Aug 24, 2010, 02:21 AM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93192
<![CDATA[Re: SEO friendly URLs with IIS]]> https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93191
Were you able to get FURLs working with Revolution?

I have a solution currently working with Evolution, but this doesn’t seem to with with Revolution.

Still searching...]]>
neilp123 Aug 20, 2010, 06:42 AM https://forums.modx.com/thread/17127/seo-friendly-urls-with-iis?page=4#dis-post-93191